Exchange Themes Overview

(Difference between revisions)
Jump to: navigation, search
(Updating template part instructions)
m
Line 3: Line 3:
 
All of Exchange's default template parts are found in the /lib/templates directory. We have broken the structure of this directory down to pretty small and specific template parts. If your theme needs to modify one of the template parts, simply copy that file and its folder hierarchy over to your theme's /exchange/ folder.
 
All of Exchange's default template parts are found in the /lib/templates directory. We have broken the structure of this directory down to pretty small and specific template parts. If your theme needs to modify one of the template parts, simply copy that file and its folder hierarchy over to your theme's /exchange/ folder.
  
We highly recommend only copying over the template parts that you must modify so that you don't have to update them when we modify template parts you haven't customized.
+
'''We highly recommend only copying over the template parts that you must modify so that you don't have to update them when we modify template parts you haven't customized.
 
+
'''
 
For example, if you need to customize how the product images look, you copy the Exchange default template part located at <code>ithemes-exchange/lib/templates/content-product/elements/product-images.php</code> over to <code>your-theme/exchange/content-product/elements/product-images.php</code> and modify it as needed.
 
For example, if you need to customize how the product images look, you copy the Exchange default template part located at <code>ithemes-exchange/lib/templates/content-product/elements/product-images.php</code> over to <code>your-theme/exchange/content-product/elements/product-images.php</code> and modify it as needed.
  

Revision as of 11:01, August 20, 2013

We've worked hard to make creating a theme for Exchange as simple as possible.

All of Exchange's default template parts are found in the /lib/templates directory. We have broken the structure of this directory down to pretty small and specific template parts. If your theme needs to modify one of the template parts, simply copy that file and its folder hierarchy over to your theme's /exchange/ folder.

We highly recommend only copying over the template parts that you must modify so that you don't have to update them when we modify template parts you haven't customized. For example, if you need to customize how the product images look, you copy the Exchange default template part located at ithemes-exchange/lib/templates/content-product/elements/product-images.php over to your-theme/exchange/content-product/elements/product-images.php and modify it as needed.

Out of the box exchange uses the standard page template (page.php) and the_content filter for displaying the content of all exchange templates (except the Super Widget).

Contents

Exchange Pages

Exchange pages are pages "created" on the fly by Exchange but do not exist in the standard pages section of the WordPress admin area. You can see a list of these pages in Exchange --> Settings --> pages. Some of the pages have the option to be disabled or replaced by a standard WordPress page/shortcode.

In order to customize the content of Exchange Pages completely, we recommend creating a file named page.php, adding it to the exchange directory (themename/exchange/page.php) and adding the following code:

get_header();

while ( have_posts() ) : the_post();
    the_content();
endwhile;

get_sidebar();
get_footer();

Of course this example is for a standard WordPress theme. If you are using a theme that uses a different method of rendering the loop (e.g. Builder) you will need to place the necessary code in exchange/page.php.

For a full list of the Exchange Pages visit Exchange » Settings » Pages in your WordPress admin area.

Products

In order to customize the content of single product pages, we recommend creating a file named product.php, adding it to the exchange directory (themename/exchange) and add the following code:

get_header();

it_exchange_get_template_part( 'content', 'product' );

get_sidebar();
get_footer();

Again, you may need to add different code depending on your theme.

Function Calls

In order to call Exchange's data in template files, you will use it_exchange() for every theme API call. We are working on the documentation for this, but you can find working examples within the Exchange templates.

See also

← Back to Exchange Codex Home

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox