shortcode issue in the_excerpt

Okay, I finally found it the answer. You need to add two filters to your functions.php file in order to run shortcodes through it. add_filter( ‘the_excerpt’, ‘shortcode_unautop’); add_filter( ‘the_excerpt’, ‘do_shortcode’);

run shortcode in excerpt of single custom post type

You just forgot to return the excerpt for the other post types. Try for example: function do_my_shortcode_in_excerpt( $excerpt ) { if ( ‘services’ == get_post_type() ) $excerpt = do_shortcode( wp_trim_words( get_the_content(), 55 ) ); return $excerpt; } add_filter( ‘get_the_excerpt’, ‘do_my_shortcode_in_excerpt’ );

Excerpt function for any content

I think that the function you need is wp_trim_excerpt. With this function you can generate a excerpt from any text: $text = “Some context”; $excerpt = wp_trim_excerpt( $text ); It is important to note that wp_trim_excerpt use the excerpt length set by WordPress, that is 55 words by default, and make use of excerpt_lenght filter, … Read more

Shortcodes in RSS excerpts

I tested following code and it worked just fine for me: function my_name_shortcode( $atts ) { return “<h3>PRASAD</h3>”; } add_shortcode( ‘name’, ‘my_name_shortcode’ ); add_filter( “the_excerpt_rss”, “do_shortcode” ); The result can be seen in below screenshot.

Modify RSS – remove image and add text

Note that the_permalink_rss() and the_excerpt_rss() do echo the output, not return it. With your current snippet, replace the_excerpt_rss() with: apply_filters( ‘the_excerpt_rss’, get_the_excerpt() ); and replace the_permalink_rss() with: esc_url( apply_filters( ‘the_permalink_rss’, get_permalink() ) ); You could also use: <content:encoded><![CDATA[ <?php the_excerpt_rss(); ?> <a href=”https://wordpress.stackexchange.com/questions/245310/<?php the_permalink_rss(); ?>”> <?php esc_html_e( ‘Read more’, ‘mydomain’ );?> </a> <?php esc_html_e( ‘at’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)