Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //structure for category template with a number of fixed posts on top; post IDs in array//
- $temp = $post;
- fixed_posts_IDs = array(1, 5, 77, 345);
- $fixed_posts = get_posts('include=' . implode(',',$fixed_posts_IDs));
- foreach( $fixed_posts as $post ) :
- setup_postdata($post);
- /*whatever you need to show of the fixed posts*/
- endforeach;
- wp_reset_query();
- $post = $temp;
- $args = array(
- 'post__not_in' => fixed_posts_IDs,
- 'cat' => get_query_var('cat'),
- 'order' => ASC
- ); /*add whatever parameters you need*/
- if( have_posts() ) :
- /*normal loop*/
- endif; wp_reset_query();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement