WordPress.org

Forums

Featured Post
[resolved] get_next_posts_link doesn't work w/ this plugin (2 posts)

  1. nalin1017
    Member
    Posted 1 year ago #

    I believe get_next_posts_link & get_previous_posts_link no longer works on pages using this plugin. Those functions will still grab all posts featured or not... so you'll end up with an erroneous 'view older posts' link where there are no more posts.

    https://wordpress.org/plugins/featured-post/

  2. WPPress
    Member
    Plugin Author

    Posted 1 year ago #

    ya. thats a bit tricky... actually you should do something like

    $old_query=$wp_query;
    $wp_query=new WP_Query(array('featured'=>'yes',...your other conditions...));
    ... Your if else and while loop with $wp_query->have_posts();
    ....your get_next_posts_link() and your get_previous_posts_link();
    $wp_query=$old_query; // restore default query variable;

    make sure you use $wp_query as wp uses it most for other helper functions if you want to use them

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Featured Post
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic