• 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

Show Full Post When Only One Post Per 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 › Show Full Post When Only One Post Per Category

This topic is: not resolved

Tagged: Blissful Theme, full post, One Post Per Category

  • This topic has 4 replies, 2 voices, and was last updated 12 years, 6 months ago by Marco.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • May 2, 2013 at 7:31 pm #39013
    martialwarrior
    Participant

    In the Blissful Child Theme, how do I show the full post in those categories where I only have one post?

    http://everythingessential.com/
    May 3, 2013 at 4:07 am #39045
    Marco
    Member

    The code below may help you, just paste it in functions.php:

    `
    /** Redirect to single post page if there is one post in category/tag */

    add_action('template_redirect', 'child_redirect_to_post');

    function child_redirect_to_post(){
    global $wp_query;

    // If there is one post on archive page
    if( is_archive() && $wp_query->post_count == 1 ){
    // Setup post data
    the_post();
    // Get permalink
    $post_url = get_permalink();
    // Redirect to post page
    wp_redirect( $post_url );
    }

    }`


    Neat & Plain – Genesis and WordPress specialist

    May 3, 2013 at 12:08 pm #39127
    martialwarrior
    Participant

    Thank you soo much!!!

    May 3, 2013 at 12:10 pm #39128
    martialwarrior
    Participant

    Does this work for any Genesis child theme?

    May 3, 2013 at 11:45 pm #39212
    Marco
    Member

    It works in any WordPress theme.


    Neat & Plain – Genesis and WordPress specialist

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