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;
}
}
Related Posts:
- How to end the excerpt with a sentence rather than a word?
- How to remove “read more” link from custom post type excerpt
- Modify ‘Read more’ link adding a new class
- Read more tag shows up on EVERY post
- Style the text before in single.php
- Ignore a more tag when using get_the_content()
- “Read more” link doesn’t show up when the post length is under the excerpt length
- Custom excerpt showing first paragraph (with HTML formatting)
- Exclude filter on front page
- How to only show the first X words (from each post) on the home page?
- Different ‘read more’ links
- Read more on the post page itself
- How to get the excerpt of a page before more tag?
- Do not show excerpt in post content
- Woocommerce “read more” instead of “add to cart” [closed]
- How to move the the_excerpt’s read more link to another div
- Turning the read more link into a button [closed]
- How to put “Read more” link in Custom Excerpt inside p tag?
- Exclude read more in the_excerpt [closed]
- How to use read more text
- Excerpt using Read More Tag
- new_excerpt_more link not working properly
- read more, even if excerpt not trimmed
- read more doesn’t display
- Give “Read More” precedence over excerpt() word count
- Exclude the content before “the more” on single posts
- How to wrap “Read More” link in a DIV tag?
- How to remove #more… from the post “More” link?
- Problem with viewing single page correctly. (taken half way down the page on click through)
- Read more to open external link
- WordPress adding a to my anchor for Read More
- Wrap More Link in Div
- Extra text… after read more tag
- How to change the “Read more” text?
- wordpress 3.8 do not have more button [closed]
- How to change the text generated by Tag
- WordPress truncate posts question (plugin related)
- Remove ‘read more’ link when post is shorter than excerpt
- “Read More” link not displaying
- Append Second Link to Read More
- “Continue reading” not on some posts, full excerpts not shown
- What code in the WP Sinatra theme generates the words “Read More?”
- Filter Post Title without affecting screen-reader-text
- How to automatically add Read more section after the first paragraphe in post?
- the_excerpt() is not trimming at
- Cannot figure out how to add a read more link to a manual excerpt. Please help
- How to use limit post content on archive page in WordPress?
- Remove Default Read More Link in Manual Excerpt RSS Feed
- create a read more link for post and archives
- Bad “read more” behavior, trying to fix by inserting tag
- Can’t Get the Read More function to work in the child theme
- Popup image from text
- Read More in the actual excerpt
- Read More link, not visible on home page
- Define excerpt length by inserting read more tag
- How to customize ‘read more’
- need help with ‘… read more’ excerpt in functions.php
- “Read More” button displays on individual Posts
- Read more link isn’t working with custom query
- Read More link scrolling page
- Can’t change excerpt length and more tag
- multiple excerpt length and styles
- how to use the_excerpt for two post queries?
- Read more content not displayed loops back to blog page
- How to add an excerpt and read more link to a page?
- WordPress excerpt for specific posts in category
- get_posts displaying wrong permalink for “continue reading” link
- why more tag is not working in my wordpress site
- Remove the excerpt and “… Read More” from the featured content on the home page with child theme
- Read more opens attachment
- Is there a way to display the ‘Read more’ link if it’s within a range?
- How to use the_excerpt in a filter hook?
- Limit the_excerpt with max of x characters
- Automatic Excerpt Not Working
- Making oEmbed work on the excerpt field
- Get the excerpt for a post created by the related author
- Auto Refresh Post List after X seconds
- How to show video from specific category on sidebar?
- the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”
- Using More Tag in Combination with the_excerpt
- Adding Videos as post-thumbnails (no stills, just the player in a smaller size)
- Mass update excerpt
- Allow HTML in Excerpts in Elementor
- Access get_the_title() from ‘excerpt_length’ filter
- How to remove first three words from content and display the excerpt
- Why is my excerpts not showing if not explicitly declared?
- Query Pages and post excerpts dynamically
- Displaying post excerpt using wpdb query
- Shortcodes showing in excerpt despite using strip_shortcodes
- Why is get_the_excerpt returning full content
- more tables created when create a new site
- truncate post with gallery tag
- Why is WordPress showing a blank excerpt for just one of my posts?
- shortcode doesnt work on excerpt
- Read More excerpt link on a post is not linking to the post itself
- How to strip header tags & shortcodes from the_excerpt()
- Cutting off excerpt with first sentence
- Inserting shortcode is blanking excerpt – any ideas?
- Get the More QuickTag button back
- the_excerpt() not working in custom archive