I want to show limit latest post of WordPress in main page. I’m using WordPress APIs and functions to show that, but after that get_the_content() remove and escape all of seved tags and my posts don’t show correctly such as editor tags.

This function escape HTML tags:

        <ul style="list-style: none;margin:5px" class="latest-posts">
            <!-- LOOP START -->
            <?php $the_query = new WP_Query( 'showposts=3' ); ?>
            <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
                <!-- THIS DISPLAYS THE POST THUMBNAIL, The array allows the image to has a custom size but is always kept proportional -->
                <li> <?php the_post_thumbnail( array(100,100) );?></li>
                <!-- THIS DISPLAYS THE POST TITLE AS A LINK TO THE MAIN POST -->
                <li>
                    <a href="<?php the_permalink() ?>">
                        <?php the_title(); ?>
                    </a>
                </li>
                <!-- THIS DISPLAYS THE EXCERPT OF THE POST -->
                <li>
                    <?php echo mb_substr(get_the_content(), 0, 1200).' ...'; ?>
                </li>
                <!-- READ MORE LINK -->
                <li><a href="<?php the_permalink() ?>">more ...</a></li>
            <?php endwhile;?>
            <!-- LOOP FINNISH -->
        </ul>

Read more here: Show exactly full content in WordPress without escape tags


Solution:

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

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: