• 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

Add latest post to page and excude 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 › General Discussion › Add latest post to page and excude category

This topic is: not resolved
  • This topic has 1 reply, 2 voices, and was last updated 12 years, 3 months ago by nutsandbolts.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 22, 2014 at 2:55 pm #106386
    bionary
    Member

    Hi,
    I use another page for the complete list of blog posts however,
    I would like to add The latest post to my home page but only if it is not from my "videos" category.
    Currently, All categories show which I do not want.
    Another problem is the entire article displays...I just want to show the image with part of the writing with the "read more" link that you normally see on a list of blog posts.

    So far I've added this to functions.php and would like some guidance, thanks

    add_action( 'genesis_after_content', 'addLastNonVideoPost' );
    function addLastNonVideoPost() {
    if(is_front_page()){
    	query_posts('category_name!=videos&showposts=1');
    	while (have_posts()) : the_post();
    		the_content();
    	endwhile;
    }
    May 22, 2014 at 11:10 pm #106445
    nutsandbolts
    Member

    Can you post a link to your site? It's always easier to help if we can see what you see.

    I'm not sure where exactly you want the latest post to display on the homepage since I haven't seen the site, but it may be easier to use a widget area (or add a new one) and use the Genesis Featured Post widget. That widget allows you to exclude certain categories, so it would be easy to tell the widget not to display any video posts.

    Displaying full posts vs. excerpts is set in Genesis > Theme Settings in the section called Content Archives. You can choose to show excerpts, full posts, or a content limit (a certain number of characters followed by a "Read More" or "Continue Reading" link) as well as choosing whether to show the featured image.

    Hope that helps!

    Edited to add: Just saw that you were using the genesis_after_content hook - definitely a prime candidate for a widget area. I have a tutorial that will help you add a widget area to a page (assuming your homepage is a static page - if you're using the included homepage template, you'll need a different solution) - http://www.nutsandboltsmedia.com/how-to-add-a-widget-area-to-a-page-using-genesis/


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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

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