Twenty Fourteen
[resolved] Keep featured content post in homepage with original order (2 posts)

  1. Naziman
    Posted 1 year ago #


    I'm searching how to keep the featured post in a blog homepage (http://naziman.com/) without exclude it from query post and i found this solution.

    Open the featured-content.php from your theme's inc folder, and look for the following code (line 269 in our case).

    $query->set( 'post__not_in', $featured );

    Simply comment out this line, by adding two slashes in front of it, to get this:

    // $query->set( 'post__not_in', $featured );

    But the file doesn't have that line and the child theme cannot overide parent theme's inc folder.

    Then, i have found another solution and its work.


    But, the problem is this code show the featured content post not in their original order. When old content post - i'm using sticky post to make featured post - become featured, the featured content post will become the first order than other post.

    I have try using conditional tag like this.

    function show_featured_content_on_home() {
    if ( !is_home() ) {
    remove_action( 'pre_get_posts', array( 'Featured_Content', 'pre_get_posts' ) );
    add_action( 'init', 'show_featured_content_on_home', 31 );

    The second page and so on okay - show the featured posts - but in homepage still have problem.

    Can anyone tell me? Thanks.

  2. Naziman
    Posted 1 year ago #

    I think i have the answer. I have to use the tag name to make featured content.

    And i have give wrong question, not how to make the post in original order but how to make the sticky post diappear at homepage.

    I will mark this topic as resolved.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic