WordPress : error while fetching post

i’m fetching posts in home page like this

    <?php
        if ( have_posts() ) :
            // Start the Loop.
            while ( have_posts() ) : the_post();

            get_template_part( 'content', get_post_format() );
            endwhile;                
            twentyfourteen_paging_nav();

        else :
            get_template_part( 'content', 'none' );

        endif;
    ?>

<?php // get_sidebar( 'content' ); ?>

it prints post but also prints this message before posts :

Read More
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){?>

‘ . ‘Read More’.’ ‘; ?>

see attached screenshot for output of post enter image description here

Related posts

1 comment

  1. Learn how to search the theme folder and search for the code that is problematic. If you don’t need it delete it, if you do need it use correct php.

    $recent_posts = wp_get_recent_posts( $args );
    foreach( $recent_posts as $recent ){?>
    
    ‘ . ‘Read More’.’ ‘; ?>
    

    The problem is it is printing the code as text because it is not using the php opening tag

Comments are closed.