Excerpt Is Disappeared

you have forgotten to return the unaltered $content if this is not a single post: function google_adsense($content) { if(is_single()) { global $post; $thePostID = $post->ID; $more_span = ‘<span id=”more-‘ .$thePostID.'”></span>’ ; return str_replace($more_span, $more_span . ” ” . google_reklam_ekle(), $content); } else { return $content; } }

read more doesn’t display

I think if( has_excerpt()) return false that’s way its return full content remove condition and only use the_excerpt() then it will work. I have another solution that i use 🙂 $content = get_the_content(); $short_content = implode(‘ ‘, array_slice(explode(‘ ‘, $content), 0, 10)); echo $short_content; this function returns 10 words of post. after echoing content you … Read more

How to use read more text

Sure, this is possible. The starting point is a filter like this, which I understand you are currently using in some form: add_filter (‘excerpt_more’,’wpse333680_more_text’,10,1); function wpse333680_more_text ($more-text) { return ‘Everything you always wanted to know about this >>’; } The function you use for the filter can easily be reused elsewhere. You could echo it … Read more

Ignore a more tag when using get_the_content()

I would just get the raw content from $post->post_content, strip the <!–more–> and then do whatever you need with the result. Just remember, $post->post_content and get_the_content() both return unfiltered text, if you need filtered content, simply apply the the_content filter to the result from those two results EXAMPLE inside the LOOP global $post; $unfiltered_content = … Read more

Style the text before in single.php

using: http://codex.wordpress.org/Function_Reference/the_content#Overriding_Archive.2FSingle_Page_Behavior and the $strip_teaser parameter: http://codex.wordpress.org/Function_Reference/the_content#Usage in single.php, replace <?php the_content(); ?> with: <?php if( strpos(get_the_content(), ‘<span id=”more-‘) ) : ?> <div class=”before-more”> <?php global $more; $more=0; the_content(”); $more=1; ?> </div> <?php endif; ?> <?php the_content(”, true); ?>