• 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

Recent Posts From Category

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 › Design Tips and Tricks › Recent Posts From Category

This topic is: not resolved

Tagged: Array, exclude, posts, recent

  • This topic has 3 replies, 3 voices, and was last updated 11 years, 9 months ago by Brad Dalton.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 22, 2013 at 3:55 am #42164
    fortyfivecreative
    Member

    Hi, wondered if anyone could help with this. Am trying to show a list of the 3 latest posts, excluding category 6, however my $projects array is not working. ie The posts are displayed but are not limited to 3 and category 6 is not being excluded.

     

    ////* 45: Add [recent_projects] shortcode */
    function ff_recent_projects_list() {
    ob_start();
    echo '<ul>';
    $projects = array( ‘numberposts’ => 3, ‘exclude’ => 6 );
    $recent_projects= wp_get_recent_posts( $projects );
    foreach( $recent_projects as $recent ){
    echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.$recent["post_title"].'" >' .   $recent["post_title"].'</a> </li> ';
    }
    echo '</ul>';
    return ob_get_clean();
    }
    add_shortcode( 'recent_projects', 'ff_recent_projects_list' );

     

    Thanks!
    David

    August 20, 2013 at 1:16 pm #57629
    Susan
    Moderator

    Hi! I'm working through the older unanswered posts today. As this thread is over three months old, I hope you have been able to get a resolution to your question. If not, can you please check in, and I will get it escalated for you.

    August 21, 2013 at 2:42 am #57860
    fortyfivecreative
    Member

    Hi Susan,

    Best of luck with the unanswered posts! Unfortunately I haven't had a response so any help would be appreciated.

    Thanks

    August 21, 2013 at 6:53 pm #58083
    Brad Dalton
    Participant

    You can use the blog page template on the home page using the Reading Settings and exclude posts from any categories using the Genesis > Theme Settings > Blog Page Template.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ 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

© 2025 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