Theming Exchange - Customize Ghost and Product Pages Output

(Difference between revisions)
Jump to: navigation, search
(Created page with "== 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 s...")
 
Line 1: Line 1:
 +
__NOTOC__
 
== Exchange Pages ==
 
== Exchange Pages ==
  
Line 15: Line 16:
  
 
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 <code>exchange/page.php</code>.
 
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 <code>exchange/page.php</code>.
 +
 +
===Builder Example===
 +
<pre class="brush:php">function render_content() {
 +
if ( have_posts() ) {
 +
while ( have_posts() ) : the_post();
 +
    the_content();
 +
endwhile;
 +
} else {
 +
do_action( 'builder_template_show_not_found' );
 +
}
 +
}
 +
add_action( 'builder_layout_engine_render_content', 'render_content' );
 +
do_action( 'builder_layout_engine_render', basename( __FILE__ ) );</pre>
  
 
For a full list of the Exchange Pages visit Exchange » Settings » Pages in your WordPress admin area.
 
For a full list of the Exchange Pages visit Exchange » Settings » Pages in your WordPress admin area.
Line 30: Line 44:
  
 
Again, you may need to add different code depending on your theme.
 
Again, you may need to add different code depending on your theme.
 
+
 
 +
===Builder Example===
 +
<pre class="brush:php">function render_content() {
 +
it_exchange_get_template_part( 'content', 'product' );
 +
}
 +
add_action( 'builder_layout_engine_render_content', 'render_content' );
 +
do_action( 'builder_layout_engine_render', basename( __FILE__ ) );</pre>
 +
 
 
----
 
----
 
    
 
    

Revision as of 08:32, October 3, 2013

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 (/exchange/page.php) in your theme, then 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.

Builder Example

function render_content() {
	if ( have_posts() ) {
		while ( have_posts() ) : the_post();
		    the_content();
		endwhile;
	} else {
		do_action( 'builder_template_show_not_found' );
	}
}
add_action( 'builder_layout_engine_render_content', 'render_content' );
do_action( 'builder_layout_engine_render', basename( __FILE__ ) );

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 (exchange/product.php) in your theme, then 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.

Builder Example

function render_content() {
	it_exchange_get_template_part( 'content', 'product' );
}
add_action( 'builder_layout_engine_render_content', 'render_content' );
do_action( 'builder_layout_engine_render', basename( __FILE__ ) );


Previous: Getting Started.

Next: Adding Custom Templates.

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox