First of all for I am sorry for not writing the question correctly. I am not sure how to express this.


I’ve created a shortcode which fetches content from another posts by post ID. The following is the shortcode function

function fetch_content_from_posts($atts, $content = null)
    global $post;
        'id' => '12345' // post id
    ), $atts));
    $output = apply_filters('the_content', get_post_field('post_content', $id));
    $output .= ob_get_contents();
    return $output;

add_shortcode('fetch_content', 'fetch_content_from_posts');


Another plugin is using the the_content filter and calling a newsletter below the single post pages. Below is the filter from that plugin which is defined in a Class function

add_filter( 'the_content', array( $this, 'display_below_single_post' ), 9999 );

My Problem

When I use the shortcode [fetch_content] in the footer text widget, the newsletter from that plugin is appended in the footer below the fetched content and not in the intended area.

Need solution

How I can fix this? I do not want to append the newsletter function in my shortcode function which is in the footer widget

Read more here: How to exclude a function from the_content filter in WordPress


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: