• Resolved rpuig

    (@rpuig)


    I try to insert the shortcode

    [rps-include post=”720″ title=”true” titletag=”h2″ ]

    The post in index.php is shown via $queried_post->post_content . This is what is in index.php

    <?php
    rewind_posts();
    $post_id = 264;
    $queried_post = get_post($post_id);
    echo $queried_post->post_content

    ?>

    The shortcode appears without showing the corresponding content and i get the shortcode displayed as normal text but no content.

    On a single post from single.php displays the content fine . This is the code in single.php

    <?php while (have_posts()) : the_post();
    php the_title();
    php the_content();?>

    So, can i get the content shown properly when including shortcode in a single post displayed with $queried_post->post_content ?

    Thank you !

    https://wordpress.org/plugins/rps-include-content/

Viewing 1 replies (of 1 total)
  • Plugin Author redpixelstudios

    (@redpixelstudios)

    The problem may be that the code used to output the post content on the index is not applying the standard content filter. Try something like this:

    echo apply_filters('the_content', $queried_post->post_content);

    It might be helpful to review what the_content goes through if you should need to only execute specific filters.

    Hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Shortcode not working inside posts shown via $queried_post->post_content ?’ is closed to new replies.