Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gedaswork

    (@gedaswork)

    Thank you. Your suggestion worked for me ??

    $iteration = 0;
    while ($query->have_posts()) {
    $query->posts[$iteration]->post_content = apply_filters(‘the_content’, $query->posts[$iteration]->post_content);
    $query->the_post();

    echo ‘<br> —–‘;
    the_content();
    echo ‘<br>’;
    $iteration++;
    }

    • This reply was modified 7 years, 10 months ago by gedaswork.
    Thread Starter gedaswork

    (@gedaswork)

    Tested in default Twentysixteen theme.
    Created a page template testmoretag.php with the following code in it, and assigned a page to it (the problem is still there):

    <?php /* Template Name: Test MoreTag */ ?>
    
    <?php get_sidebar(); ?> <!-- only WPGlobus language switcher in the sidebar -->
    <?php
    $query = new WP_Query( array( ‘post_type’ => ‘post’) );
    while ($query->have_posts()){
    	$query->the_post();
    	echo '<br> -----';
    	the_content();
    	echo '<br>';
    }
    ?>

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    • This reply was modified 7 years, 10 months ago by bdbrown.
    Thread Starter gedaswork

    (@gedaswork)

    Thanks for a quick reply;

    Yes, apologies for posting before doing more research. I’ve done more digging and it seems this problem occurs if we use a custom wp_query (this example is enough to break it):

    $query = new WP_Query( array( 'post_type' => 'post') );
    while ($query->have_posts()){
    $query->the_post();
    the_content();
    }

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    • This reply was modified 7 years, 10 months ago by bdbrown.
Viewing 3 replies - 1 through 3 (of 3 total)