• 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

How to show full text of the first post?

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 › How to show full text of the first post?

This topic is: not resolved

Tagged: lifestyle, limit, readmore, sticky

  • This topic has 10 replies, 2 voices, and was last updated 11 years, 2 months ago by Genesis Developer.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • September 2, 2014 at 9:29 am #122419
    korg007
    Member

    Hi all,
    I have a site with the max characters in posts for the blog list set to show... equal to 200. I did this because I want to automatically limit the amount of text show in the blogs on the blog list.

    However, as a first post, I have a "sticky" post for which I want the entire text to show. I don't want a "readmore" link on the blog list page for this post.

    How can I override the character limit for this single post? or... is there another approach?
    Thanks!

    September 2, 2014 at 9:52 am #122421
    Genesis Developer
    Member

    are you using genesis blog page template? or you just wanting this for home page? Can you give your site url?


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

    September 2, 2014 at 9:57 am #122422
    korg007
    Member

    Thanks,
    yes, using the Genesis blog page template (I think). It's not on the home page.

    here's the link:
    http://www.sayingitforward.ca/my-blog/

    Cheers,
    G

    September 2, 2014 at 9:58 am #122423
    Genesis Developer
    Member

    you can try this code

    add_action('template_redirect', 'sp_custom_post_content');
    function sp_custom_post_content(){
      // only work for home & blog template page
      if( is_home() || is_front_page() || is_page_template('page_blog.php') ){
        remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
        remove_action( 'genesis_post_content', 'genesis_do_post_content' );
        add_action( 'genesis_entry_content', 'genesis_do_custom_post_content' );
        add_action( 'genesis_post_content', 'genesis_do_custom_post_content' );
      }
    }
    function genesis_do_custom_post_content(){
      global $wp_query;
      if( $wp_query->current_post == 0 ){
       // Only first post will display full content
        the_content();
      }else{
        the_content_limit( (int) genesis_get_option( 'content_archive_limit' ), __( '[Read more...]', 'genesis' ) );
      }
    }

    You can change the conditional tag if( is_home() || is_front_page() || is_page_template('page_blog.php') ){ based on your requirement.


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

    September 2, 2014 at 10:03 am #122424
    Genesis Developer
    Member

    Ok. Then change this line

    if( is_home() || is_front_page() || is_page_template('page_blog.php') ){

    by

    if( is_page_template('page_blog.php') ){

    you'll write the full the code in your functions.php file


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

    September 2, 2014 at 10:05 am #122425
    korg007
    Member

    Thanks for the quick response!
    I'm coming from Joomla so bear with me.

    Do I change or add this code? and... is this all in functions.php of the theme?

    I'm assuming there isn't a plugin so I don't have to mess with theme code which will be reset when I update the theme?

    If I were to use the READMORE feature (manually in each post) instead of the using the char limit. How do I configure my installation for each post in the blog list to display the first image found in the post, as a "feature image"?
    G

    September 2, 2014 at 11:50 am #122437
    korg007
    Member

    I'm confused. Do I simply add the first code snippets in functions.php of the theme?
    Thanks,
    G

    September 2, 2014 at 12:15 pm #122442
    korg007
    Member

    Hi again genwrock,
    I added the code at the bottom of the theme's functions.php and changed the cond statement as you suggested.
    Nothing changed at all.
    What am i missing?

    September 2, 2014 at 12:54 pm #122450
    Genesis Developer
    Member

    I’m coming from Joomla so bear with me.

    Are you using Genesis framework? I don't anything about Joomla.


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

    September 2, 2014 at 12:55 pm #122452
    korg007
    Member

    Yes I am. The lifestylePro theme.

    September 2, 2014 at 2:11 pm #122476
    Genesis Developer
    Member

    Ok. Are you added this full code in your functions.php file?

    add_action('template_redirect', 'sp_custom_post_content');
    function sp_custom_post_content(){
      // only work for home & blog template page
      if( is_page_template('page_blog.php') ){
        remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
        remove_action( 'genesis_post_content', 'genesis_do_post_content' );
        add_action( 'genesis_entry_content', 'genesis_do_custom_post_content' );
        add_action( 'genesis_post_content', 'genesis_do_custom_post_content' );
      }
    }
    function genesis_do_custom_post_content(){
      global $wp_query;
      if( $wp_query->current_post == 0 ){
       // Only first post will display full content
        the_content();
      }else{
        the_content_limit( (int) genesis_get_option( 'content_archive_limit' ), __( '[Read more...]', 'genesis' ) );
      }
    }

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

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

© 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