Help with get_post breaking conditional tag
-
Hi,
My apologies if this has been answered elsewhere. I know that people have tackled a similar problem here but I’m new to PHP and am having trouble implementing other given fixes in my code.
I have a conditional tag in my footer so that certain elements from it don’t display on a certain page (page 15):
<?php if( !is_page( '15' ) ) : ?>
Within page 15, I have code to call up a certain post type (“Accessories”):
<?php $type = 'Accessories'; $args=array( 'post_type' => $type, 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => 3, 'caller_get_posts'=> 1 ); $temp = $wp_query; // assign orginal query to temp variable for later use $wp_query = null; $wp_query = new WP_Query($args); ?> <?php while(have_posts()):the_post(); the_content();endwhile;?>
I know the latter code is breaking the former code in some way. I think this must be a problem with the WP_Query function but am clueless about how to fix it. Any help would be much appreciated.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Help with get_post breaking conditional tag’ is closed to new replies.