WordPress.org

Forums

Featured Post
[resolved] Featured posts only showing in Front Page (6 posts)

  1. farshid.t
    Member
    Posted 1 year ago #

    Hi and thanks for the great Plugin.

    I have added the query_posts function before the main loop and it does work when the page is set as Front Page in WP Reading Settings.

    However the query returns blank if the page is not Front Page, such as "/?page_id=11".

    Is this a bug or do you suggest any way to trace back the error?

    Thanks a lot!

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

  2. WPPress
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,
    can you paste your piece of code? so i can check what really is happening?

  3. farshid.t
    Member
    Posted 1 year ago #

    Sure. But it turns out that there is conflict with my custom template. Nothing wrong on the plugin's side.

    This is the relevant piece.

    <div class="container">		
    
    			<!-- FEATURED FILTERING -->
    			<?php query_posts($query_string."&posts_per_page=100&featured=yes"); ?>
    			<!------------------------>
    
    			<?php while (have_posts()) : the_post(); ?>
    	                     // show posts data, etc
    			<?php endwhile; ?>
    			<!-- /STOP LOOP -->
    			<?php wp_reset_query(); ?>
    
    		</div>	
    
    	</div>

    Thanks

  4. WPPress
    Member
    Plugin Author

    Posted 1 year ago #

    did you try calling wp_reset_query() before query_posts() ?

  5. WPPress
    Member
    Plugin Author

    Posted 1 year ago #

    Fixed?

  6. farshid.t
    Member
    Posted 1 year ago #

    Sorry I couldn't try during the weekend.

    wp_reset_query() doesn't fix it, removing one of the template classes does. I guess a JS function is messing with it.

    I set my featured as front page, and it works fine there.

    Thanks anyway :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic