Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: show recent 5 posts in a page using get_template_part

Discussion in 'Misc WordPress Requests' started by Bluekid, Oct 18, 2017.

  1. Bluekid

    Guest

    Reply To: show recent 5 posts in a page using get_template_part, by Bluekid

    I think i solved… in the content-excerpt.php i add this code:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php static $count = 0;
    if ($count == "5") { break; }
    else { ?>

    ----------------HERE THE CODE OF CONTENT-EXCERPT.PHP----------------

    <?php $count++; } ?>
    <?php endwhile; ?>
    <?php endif; ?>

    it’s a good idea? what do you think?

    Reply To: show recent 5 posts in a page using get_template_part
     
    #1

Share This Page

Web Hosting