The following files are mandatory and should be included in any Coupons CMS theme:

  • index.php
  • search.php
  • single.php
  • store.php
  • stores.php
  • category.php
  • page.php
  • site_header.php
  • site_footer.php
  • style.css
  • 404.php

The following files are not mandatory but it’s recommended to be included:

  • info.txt – the script is looking into this file for theme information like version, publishder name and website, description. Version: 1.0
    Published by: CouponsCMS http://couponscms.com
    Description: Default theme for CouponsCMS v6.00
  • preview.png
  • product.php – only if your theme is designed to display products, this will become the template for single product
  • functions.php – in this file should be included all custom functions using in the theme

 

index.php

index.php is name given to the home page of the website. Thus when a user navigates to www.example.org, the webserver delivers www.example.org/index.php

 

search.php

Search page used by Coupons CMS, the search is made by a query string such as:

http://example.org/?s=searched-text

Here is an example of a full query string using all optional keys and values

http://example.org/?s=searched-text&category=1&type=coupons|products|stores|locations

For search.php template also can be used the following functions:

searched_type();

this function return the type searched and this is one of: coupons, products, stores, locations

have_items( optional $atts );

this function return a full navigation array and activate the following functions:

  • results() – the same return with have_items();
  • page() – return current page – integer
  • pages() – return number of all pages – integer
  • next_page() – return next page URL – string
  • prev_page() – return previous page URL – string

have_items() function can be used for the following templates: stores.php, reviews.php and category.php with the same effect

items( optional $atts );

this function return an array with all objects found

 

Example:

have_items();
if( results() ) {
foreach( items() as $item ) {
// print_r( $item );
}

 

single.php

Template used for single coupon page, to get information about the current item is necessary to use the following function:

$item = the_item();
// print_r( $item );

the_item(); can be used to get information about an item also for the following templates: store.php, category.php, product.php

 

site_header.php

Page included before any page template

 

site_footer.php

Page included after any page template

 

style.css

Main CSS file used in any theme

 

Themes accept custom pages, for example “contact.php” page can be accessed by this URL: http://example.org/contact.html