Support » Fixing WordPress » Custom Page Template

  • Robert

    (@robbieb1953)


    To create a custom page template to exclude sticky posts from one category, codex provides the following:

    $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
    $sticky = get_option( 'sticky_posts' );
    $args = array(
    	'cat' => 3,
    	'ignore_sticky_posts' => 1,
    	'post__not_in' => $sticky,
    	'paged' => $paged
    );
    $query = new WP_Query( $args );

    At what line do I insert this in my page template?

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Custom Page Template’ is closed to new replies.