Using <!--more--> tag to output text in Genesis?
here's what i'm trying to achieve!
HTML:
some text
!--more--
some text
when post is loaded:
some text
MY TEXT WHICH WAS ADDED TO THE MORE TAG
some text
on my old WP site, i used this to have a banner displayed on posts exactly where the tag was inserted.
unfortunately, i can't get this to work in Genesis.
here's the code which was added to functions.php on my old website:
function adsense_added_at_more_tag($text) {
if( is_single() ) :
$ads_text = 'BANNER GOES HERE';
$pos1 = strpos($text, 'span id="more-');
$pos2 = strpos($text, '/span', $pos1);
$text1 = substr($text, 0, $pos2);
$text2 = substr($text, $pos2);
$text = $text1 . $ads_text . $text2;
endif;
return $text;
}
any ideas on how to get this to work in Genesis?
i got some great tips from Brad who suggested the following code:
add_filter( 'the_content_more_link', 'read_more_link' );
function read_more_link() {
if ( is_single() ) {
echo 'div class="your-banner"Add Your Banner HTML Here/div';
}
}
i've tried adding this to functions.php in Genesis, but nothing happens. the "Add Your Banner HTML Here" text doesn't appear in the post.
i've explored various code examples online and tried tweaking the code pasted above with my (it's safe to say) non-existant PHP skills without success.
can anyone figure out how to modify the code to show text in a single post in Genesis?