help
Try adding the global $more variable before you call the_content(). e.g.: <?php global $more; $more = 0; the_content( ‘Read More’ ); ?> (This is how you enable the “Read More” tag for Pages.)
Try adding the global $more variable before you call the_content(). e.g.: <?php global $more; $more = 0; the_content( ‘Read More’ ); ?> (This is how you enable the “Read More” tag for Pages.)
Simply go and apply the default filter: // You´ll likely need a function that doesn´t echo/print the output to get this working // without an error echo apply_filters( ‘the_excerpt’, get_field( ‘YOUR_FIELD_NAME’, get_the_ID() ) );
You are using more tag to split article into teaser and rest of content. “More” link assumes that reader already done with former and tries to navigate browser to that point in full article. Codex has modifying this behavior documented in Customizing the Read More > Prevent Page Scroll When Clicking the More Link and … Read more
Hmm, and what is the difficulty in here? You already have global $post variable in your function. Just use it. function excerpt_read_more_link($output) { global $post; $text=”Read more”; if ( $post->post_type == ‘MY-CUSTOM-POST-TYPE’ ) // change MY-CUSTOM-POST-TYPE to your real CPT name $text=”Get it now”; return $output . ‘<a class=”more-link” href=”‘. get_permalink($post->ID) . ‘”>’. $text .'</a>’; … Read more
There you go this will prevent scroll (add to functions.php) function remove_more_link_scroll( $link ) { $link = preg_replace( ‘|#more-[0-9]+|’, ”, $link ); return $link; } add_filter( ‘the_content_more_link’, ‘remove_more_link_scroll’ ); Explained in depth Here.
You can achieve this with many ways. First thing you need to use the_excerpt() instead of the_content() and in your functions.php file you can add this function to return 0 text from post text. function custom_excerpt_length($length) { if (is_home()) { return 0; } } add_filter(‘excerpt_length’, ‘custom_excerpt_length’); This code check if this is homepage you can … Read more
set the $stripteaser parameter to true; the_content(‘readmore’, true); http://codex.wordpress.org/Function_Reference/the_content
Put a filter on the_content_more_link. Untested but… function wrap_more_link($more) { return ‘<div>’.$more.'</div>’; } add_filter(‘the_content_more_link’,’wrap_more_link’);
You probably looking at something like get_extended(). It returns the content in an array with the following key=>value pairs main => The content before the more tag extended => The content after the more tag more_text => The custom read more text So you would want to do the following in your single post page … Read more
Login after “Read More” then return to article