Shortcode in excerpt
Shortcode in excerpt
Shortcode in excerpt
This should output the text at the bottom of each ‘single’ post add_filter( ‘the_content’, ‘my_the_content_filter’, 0 ); function my_the_content_filter( $content ) { if ( is_single() ) { global $post; $content .= “<p>here will be some data retrieved from the database, it will be beneath every post. I like it!</p>”; } return $content; } you could … Read more
Try the solution by @Pieter Goosen i found for me it was the best solution, and it easy to customise. if ( ! function_exists( ‘pietergoosen_custom_wp_trim_excerpt’ ) ) : function pietergoosen_custom_wp_trim_excerpt($pietergoosen_excerpt) { global $post; $raw_excerpt = $pietergoosen_excerpt; if ( ” == $pietergoosen_excerpt ) { $pietergoosen_excerpt = get_the_content(”); $pietergoosen_excerpt = strip_shortcodes( $pietergoosen_excerpt ); $pietergoosen_excerpt = apply_filters(‘the_content’, $pietergoosen_excerpt); … Read more
Excerpt being limited too early
Keep excerpt from stripping URLs and enable autoembed for youtube ONLY?
Remove Shortcodes First, try this on your functions.php: add_filter( ‘get_the_excerpt’, ‘strip_shortcodes’, 20 ); If it doesn’t work then try this edit. echo strip_shortcodes( get_the_excerpt() ); In case the shortcode is not registered with WordPress function add_shortcode add_filter( ‘the_excerpt’, ‘remove_shortcodes_in_excerpt’, 20 ); function remove_shortcodes_in_excerpt( $content){ $content = strip_shortcodes($content); $tagnames = array(‘box’, ‘alert’); // add shortcode tag … Read more
get_the_permalink() does not modify or do anything to the_excerpt(). That’s now how viewing post content works. All it does is output the permalink the single post. When you visit that link it will load a single post using the template it finds according to the template hierarchy. You need to make sure that the template … Read more
the_excerpt strips away html tags. You will need to switch to the_content and use quick tag instead. view the docs on this Basic Example: <?php the_content( ‘Read more …’ ); ?>
Not sure if I understood your question correctly, but in the codex it reads: If adding the excerpt manually, you may use (some) HTML formatting and the tags will not be stripped. So if the only thing you want to do is make part of the text bigger, just add for instance: example text <span … Read more
One thing that can be happening is if you have added a Read more tag in your content it is overriding the manual excerpt. just check and see if you have <!–more–> tag in your content body. if so remove it. The next thing is the_excerpt()may use auto generated excerpt. it is said in Wp … Read more