• 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

ashleymichelle

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
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 1, 2018 at 1:28 am in reply to: Wrap Excerpt In Custom Tag #219460
    ashleymichelle
    Member

    For anyone else interested in a solution to wrapping the_excerpt into a <p class=""> tag, here is what I used (I put it into a custom plugin).

    // * Excerpt Formatting *//
    
    add_filter( 'the_excerpt', 'bonbon_excerpt' );
    function bonbon_excerpt() {
    	return '<p class="excerpt">' . get_the_excerpt() . '</a>';
    }
    April 25, 2018 at 8:00 pm in reply to: Add Custom Fields To Genesis Child Theme #219285
    ashleymichelle
    Member

    Could you reference or show me an example of how to do this? I'm a visual designer rather than developer, so my knowledge base is highly learn-as-I-go, and my googling skills apparently aren't showing me what I need to find.

    Many thanks!

    April 24, 2018 at 6:27 pm in reply to: Add Custom Fields To Genesis Child Theme #219244
    ashleymichelle
    Member

    Hi Brad,
    I did figure out how to implement it; Genesis newbie here.

    However, my next question is, how do I consolidate all of this into one hook, so that I can apply a single class? I'd like to wrap all of this within a divider, ".awrap"...

    add_action( 'genesis_before_entry_content', 'affiliate_link', 12 );
    function affiliate_link() {
    
    if ( is_single() )
    
        $value = get_post_meta( get_the_ID(), 'affiliates', true );
        
        if ( ! empty( $value ) ) {
        
        echo '<span class="awrap"><a href="/./affiliates" target="_blank">affiliate link</a></span>';
        
        }
    }
    
    add_action( 'genesis_before_entry_content', 'pr_sample', 12 );
    function pr_sample() {
    
    if ( is_single() )
    
        $value = get_post_meta( get_the_ID(), 'prsample', true );
        
        if ( ! empty( $value ) ) {
        
        echo '<span class="awrap"><a class="prsample" href="/./pr" target="_blank">gift</a></span>';
        
        }
    }
    
    add_action( 'genesis_before_entry_content', 'pr_post', 12 );
    function pr_post() {
    
    if ( is_single() )
    
        $value = get_post_meta( get_the_ID(), 'prpost', true );
        
        if ( ! empty( $value ) ) {
        
        echo '<span class="awrap"><a class="prpost" href="/./pr" target="_blank">PR</a></span>';
        
        }
    }
    
    add_action( 'genesis_before_entry_content', 'buy_it', 12 );
    function buy_it() {
    
    if ( is_single() )
    
        $value = get_post_meta( get_the_ID(), 'buyit', true );
        
        if ( ! empty( $value ) ) {
        
        echo '<span class="awrap"><a class="buyit" href="'. $value .'" target="_blank">Get It Here</a></span>';
        
        }
    }
    

    Thank you!

    April 23, 2018 at 2:45 pm in reply to: Wrap Excerpt In Custom Tag #219205
    ashleymichelle
    Member

    Also, I would like to remove all excerpts while maintaining the "Read More" link, unless they are manual excerpts.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)

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