Where Do I Place Your Code?
-
Hi, I would really like to try your plugin but I can’t figure out where to place the code you’ve provided. I know it goes into my theme but which php page? Do I add this to my theme’s function.php or to theme CSS…
I would like to add this or similar code so I can call a specific category, on a specific page for a certain number of pages. Is this correct:
<?php
// You need protect against arbitrary paged values
$paged = ( get_query_var( ‘paged’ ) ) ? absint( get_query_var( ‘paged’ ) ) : 1;$args = array(
‘post_type’ => ‘post’,
‘posts_per_page’ => 10,
‘cat’ => 80,
‘paged’ => $paged,
);$my_query = new WP_Query( $args );
if($my_query->have_posts()):
while($my_query->have_posts()): $my_query->the_post();
// Template loop here
endwhile;
echo easy_wp_pagenavigation( $my_query );
else:
// No result
endif; wp_reset_postdata();
?>
- The topic ‘Where Do I Place Your Code?’ is closed to new replies.