Forum Replies Created
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
ashleymichelleMember
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>'; }
ashleymichelleMemberCould 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!
ashleymichelleMemberHi 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!
ashleymichelleMemberAlso, I would like to remove all excerpts while maintaining the "Read More" link, unless they are manual excerpts.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)