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

not functioning

I see several things that may be contributing to your issue. First, you’re using a custom page template to display the blog posts index, instead of using home.php as specified by the Template Hierarchy. That might be a problem, because the <!–more–> tag doesn’t work on singular pages, and since you’re doing funky things with … 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); ?>

Modify ‘Read more’ link adding a new class

What (exactly) happens When calling the_content() inside your template, you are able to call it without any parameters. This means, that the function already has the defaults of null for both arguments: The “more” link text and the boolean switch that allows you to strip teaser content before the “more” link text. The the_content() function … Read more

Hide/show content starting in the middle of a paragraph

The problem with what you’re trying to do is that you split a block type html element <p>. In your example you effectively have <p><div></p></div>, which is simply no good. So you cannot mix <p> and <div> in this way. You can, however use a combination of paragraphs and classes: <p>Text</p><p class=”hide-from-here”>More text</p> Where it … Read more

How to remove “read more” link from custom post type excerpt

Put the following code in functions.php to show “read more” on all post types except custom_post_type. function excerpt_read_more_link($output) { global $post; if ($post->post_type != ‘custom_post_type’) { $output .= ‘<p><a href=”‘. get_permalink($post->ID) . ‘”>read more</a></p>’; } return $output; } add_filter(‘the_excerpt’, ‘excerpt_read_more_link’);

How to end the excerpt with a sentence rather than a word?

This requires PHP 5.3+ (WP requires PHP 5.2.4+) add_filter(‘get_the_excerpt’, ‘end_with_sentence’); function end_with_sentence($excerpt) { $allowed_end = array(‘.’, ‘!’, ‘?’, ‘…’); $exc = explode( ‘ ‘, $excerpt ); $found = false; $last=””; while ( ! $found && ! empty($exc) ) { $last = array_pop($exc); $end = strrev( $last ); $found = in_array( $end{0}, $allowed_end ); } return … Read more