WordPress.org

Ready to get started?Download WordPress

Forums

Untitled
[resolved] [closed] Show "featured" post in "recent" posts at the same time (6 posts)

  1. yenzb
    Member
    Posted 1 year ago #

    Hi!

    I am loving the Untitled theme.
    The only problem I have is if I mark a post as featured (and it appears with its large picture on top of the site) it gets out of the "latest" posts section.
    I read a lot about this online and it makes sense in many cases that there are no duplicates.
    But for me it would be great if I could disable this function and see a featured post at the same time below in the latest posts section.
    Maybe delete some lines of code in the functions.php? But which ones?

    Thanks for your help!
    Regards
    Jens

  2. Hi Jens, Untitled uses Jetpack's Featured Content module to exclude posts from the main blog stream if they've been tagged as featured content.

    To override that, you'll need to create a child theme and add a special function to it.

    Making a child theme means your changes won't be overwritten when you update the theme. If you're new to child themes, you can explore these guides:

    http://codex.wordpress.org/Child_Themes
    http://op111.net/53/
    http://vimeo.com/49770088

    Next, create a plain-text file, name it functions.php, and place it in your child theme folder.

    Now put this function between opening and closing PHP tags:

    <?php
    
    function jeherve_add_featured_content_to_blog() {
        remove_action( 'pre_get_posts', array( 'Featured_Content', 'pre_get_posts' ) );
    }
    add_action( 'init', 'jeherve_add_featured_content_to_blog', 31 ); // Immediately after FC hooks in
    
    ?>

    That function is from one of the Jetpack support-team members, Jeremy Herve, and you can see the original here:

    https://github.com/jeherve/pinkman/blob/master/inc/jetpack.php#L50

    I tested it on my end and it's working for me.

    Let me know how it goes!

  3. yenzb
    Member
    Posted 1 year ago #

    Hi there!

    Thanks so much, it worked out just as you explaned!

    Regards
    Jens

  4. Great, glad that did the trick!

  5. johntylerallen
    Member
    Posted 10 months ago #

    Hi!

    This was helpful. I managed to show my featured posts in the recent posts section below the rotating header, but now my text (date, title, etc.) now appears below the thumbnail. I have no idea how to correct. Can you help?

    Thanks!

  6. Kathryn
    Automattic Happiness Engineer
    Posted 10 months ago #

    johntylerallen - could you please start a new thread for your issue, including a link to your site? Thanks.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.