Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to create a new website with reversed pagination (I mean latest post is found in last page , while oldest one is found in first page) I could do that already with "Default Sort Ascend" plugin.

Now what I want is to set front page to be the last page of a specific category (even with redirection) ... ANY HELP ??

share|improve this question

1 Answer 1

you can use the per_get_posts filter hook to change the order of the query something like:

add_filter('pre_get_posts', 'filter_homepage_posts_order');
function filter_homepage_posts_order($query) {
    //only run is current page is home page
    if ($query->is_home) {
        $limit_number_of_posts = 5; //number of posts 
        $featured_category_id = get_cat_id('Reviews'); // by cat name...
        $query->set('cat', $featured_category_id);
        $query->set('posts_per_page', $limit_number_of_posts);
        $query->set('order','DESC')
    }
  return $query;
}
share|improve this answer
    
Thanks, It really shows last posts from that category ,but without pagination reversed also the menu bar now shows my other pages (not my custom links) ! I'm ok with showing posts from a specific category, what I want is to either direct homepage to last page of that category or reverse its pagination so that last page shows newst post while first page shows OLDEST post. –  Bialy Aug 10 '11 at 13:49
    
What ??? it works? not Working? –  Bainternet Aug 10 '11 at 13:51
    
sorry, comment got disturped :) I re-edited it –  Bialy Aug 10 '11 at 13:52
    
about reversed pagination , as I said before that I used a plugin to revese posts query so my NEWEST post is shown in last page, but when I enter this category it shows page one which displayes the oldest post :( I hop you understand me ! –  Bialy Aug 10 '11 at 13:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.