• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Exclude Current Post from Genesis – Featured Posts

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Exclude Current Post from Genesis – Featured Posts

This topic is: not resolved

Tagged: genesis featured posts, recent posts

  • This topic has 2 replies, 3 voices, and was last updated 7 years, 3 months ago by Genesis Developer.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • November 27, 2015 at 7:56 am #172099
    Mark-C
    Member

    Hi All,

    I have set up a Widget to display Genesis - Featured Posts. 3 featured posts are displayed in descending order from all categories.

    My functions.php code:
    // Add support for after entry widget
    add_theme_support( 'genesis-after-entry-widget-area' );

    // Remove after entry widget, so you can add to it
    remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );

    // Add after entry widget to posts, testimonial, and portfolio
    add_action( 'genesis_after_entry', 'mc_after_entry', 9 );
    function mc_after_entry() {

    if ( ! is_singular( array( 'post' )) )
    return;

    genesis_widget_area( 'after-entry', array(
    'before' => '<div class="after-entry widget-area">',
    'after' => '</div>',
    ) );

    }

    Problem:
    When I launch an article as shown below then it appears in my recent posts.
    Article 1 - Shown (as i have set the number of posts to 3)
    Article 2 - Shown (as i have set the number of posts to 3)
    Article 3 - Shown (as i have set the number of posts to 3)
    Article 4 onwards - not show ... all good.

    Requirement
    How can i exclude the current post from being displayed in my recent posts.

    Thanks in advance

    Mark C

    November 29, 2015 at 5:39 pm #172227
    Brad Dalton
    Participant

    If the widget includes settings, then you can use them otherwise you'll need to find a plugin which includes that functionality.


    Tutorials for StudioPress Themes.

    November 29, 2015 at 11:53 pm #172250
    Genesis Developer
    Member

    This tutorial is for you.


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble