Tag Info

Hot answers tagged

4

You don't declare the order of the results when you register the post type. Instead, you do at the time the results are requested. If you're using WP_Query to get the results then you add your orderby and order arguments to the request. http://codex.wordpress.org/Class_Reference/WP_Query If you want to change the order of the results on the archive pages ...


1

Please note: This is just an extension to the other answer As already mentioned in the other answer, orderby and order are invalid arguments supplied for register_post_type You should take your time and work through the link provided above. I just also want to raise this, you cannot use calender as your post type name. It is a reserved name.You will have ...


1

As Tom said, you should never use query_posts and should almost always pass any arguments as an array. I think this will achieve what you want: <?php // Arguments $args = array(' 'nopaging' => true, 'terms' => 'featured', 'posts_per_page' => 15, 'orderby' => 'rand', ...


1

You should use the pre_get_posts filter for this. For example, you could do this in your theme's functions.php file: function limit_category_posts( $query ) { if ( $query->is_archive() ) { // Do not do this for the date or category archives. if ( $query->is_date() || $query->is_category() ) return $query; ...



Only top voted, non community-wiki answers of a minimum length are eligible