• 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

Post Excerpts at the Beginning of Each 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 › Design Tips and Tricks › Post Excerpts at the Beginning of Each Post

This topic is: resolved

Tagged: post excerpt

  • This topic has 5 replies, 2 voices, and was last updated 9 years, 1 month ago by wbxpress.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • February 11, 2014 at 8:11 am #89796
    wbxpress
    Member

    Hi, I would like to display handicraft post excerpt at the very beginning of each post just below the post title. Can anyone help me please?

    http://wbxpress.com/
    February 11, 2014 at 9:30 am #89827
    chillybin
    Member

    Add this to functions.php

    add_action('genesis_entry_header','custom_excerpt', 11);
    function custom_excerpt() {
      the_excerpt();
    }

    So then you can use the excerpt area in wordpress (use screen options if not showing) to write your own excerpts.

    You can change the number 11 at the end higher or lower to position the excerpt in the entry meta area


    We are a web design & development consultancy based in Singapore who specialise in all things WordPress & Genesis. | ChillyBin Web Design & Consultancy: http://www.chillybin.com.sg | Twitter: @chillybindesign

    February 11, 2014 at 9:50 am #89833
    wbxpress
    Member

    Hi,

    Thank you for the code above. This code is working nice with single post display. But there is some problem with my settings. I have already implemented some tweaks to display excerpts instead of full post at the home page, search page, category page etc. So, at the home page excerpts are displaying twice.
    Please let me know how to fix this.
    Secondly, I would appreciate if you kindly help me to display excerpts inside a content box (light blue).

    February 11, 2014 at 11:56 am #89843
    wbxpress
    Member

    Hi,

    I just changed the above to suite my needs and it worked perfect.

    add_action('genesis_entry_header','custom_excerpt', 11);
    function custom_excerpt() {
      if ( is_single() )
      the_excerpt();
    }

    However, I am struggling to find a way to display the excerpt in a content box. I have working content-box class but could not find the way to implement it.

    February 12, 2014 at 8:04 am #89960
    chillybin
    Member

    This should help

    add_action('genesis_entry_header','custom_excerpt', 11);
    function custom_excerpt() {
      if ( is_single() )
      ?><div class="content-box"><? 
      the_excerpt();
      ?></div><?
    }

    We are a web design & development consultancy based in Singapore who specialise in all things WordPress & Genesis. | ChillyBin Web Design & Consultancy: http://www.chillybin.com.sg | Twitter: @chillybindesign

    February 12, 2014 at 10:28 am #89984
    wbxpress
    Member

    Hi chillybin, i have found almost a similar way to achieve this. I just inserted the below code in simple hooks plugin at the genesis-entry-header:-

    <?php if ( is_singular() ) { ?>
    <div class="content-box">
    <?php the_excerpt(); ?>
    </div>
    <?php } ?>

    Thanks for your kind support. You are awesome.

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

© 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