Loop on a wordpress Page instead of content coming from the WP text editor

On your custom page template, the default loop is working and that’s why the loop is fetching content from the page. You need a custom query in this case. Here’s the code. <?php $query = new WP_Query( array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ) ); if ( $query->have_posts() ) { while ( $query->have_posts() ) … Read more

Including 2 Negative Is_Template Conditionals in header.php [closed]

(Expanding on Pieter’s comment above, and explaining the logic behind it…) if() evaluates the conditions in the parentheses, and that evaluation results in either TRUE or FALSE for the sum total (which can change, depending on how the various conditions are combined). In plain English, if( !is_singular(‘device’) || !is_front_page() ) means, “If it’s either true … Read more

Templates to use multiple time within page? [closed]

If you are trying to do this within a page or post, you could make a shortcode out of it. [movie-template title=”Gone With the Wind” date=”1939″ image=”gwtw.jpg”] [movie-template title=”Citizen Kane” date=”1941″ image=”ck.jpg”] [movie-template title=”Star Wars” date=”1977″ image=”sw.jpg”] Then you need a little code, in your template’s functions.php, or in a custom plugin: add_shortcode( ‘movie-template’, ‘my_movie_listings’ … Read more

Same posts within a paginated page

The problem is that you are running query_posts in the middle of the page, which, by the way you should nearly never do. That will overwrite the main query– the global $wp_query object. Pagination should probably appear to work. The problem is that the original main query runs before your template loads and thus before … Read more