Display Last Post(s)
full list of post display arguments (2 posts)

  1. relaxedguy
    Posted 5 years ago #

    I would like to display the last five post titles as links to each individual blog posts.
    I cannot figure out how to do this, plugin always displays the title and excerpt.

    From the demo code I replaced "excerpt" with title but it doesn't work.

    <?php lastPosts(5,'title'); ?>

    What is the exact code?



  2. ABCDiamond
    Posted 4 years ago #

    I will hazard a guess at this.

    Find this code in "display-last-post.php"

    if ($cont != 'cont') { $retour.= get_the_excerpt().PHP_EOL; } else $retour.= fb_the_content().PHP_EOL;
    $retour .= '<div class="author">'.get_the_author().'</div>'.PHP_EOL;
    $retour.='</ul> ';

    and remove the excerpt and content sections, leaving just this:

    if ($cont != 'cont') { $retour .= '<div class="author">'.get_the_author().'</div>'.PHP_EOL;
    $retour.='</ul> ';

    I've not tested this one, so back up your "display-last-post.php" file content first so you can replace the exact content if it gives a temporary fatal error.

    If this does not work, I use a different plugin to get the result you need. See http://abcdiamond.com.au for an example page using both types of options.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Display Last Post(s)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic