WordPress.org

Ready to get started?Download WordPress

Forums

How to post an abstract of the latest post to my front page (15 posts)

  1. websage
    Member
    Posted 9 years ago #

    Hello, I am working on this site:
    http://lawrencemmiller.com

    The WP blog is at:
    http://lawrencemmiller.com/blog

    I would like to place in the right column of http://lawrencemmiller.com/ just below the photo of the author an automatically updated abstract of the latest blog post.

    How do I do that? Thanks in advance for your time! I love WP (although I am new to it) and I think I will move my MT sites to WP as well.

  2. Root
    Member
    Posted 9 years ago #

    I am only just beginning to get into this myself and cant give a precise answer. But I am thinking in terms of running the loop twice. First time round it will pick up something very similar to what you want. Second time round it will do the whole lot. For this type of high end dev you would be best consulting the awesome codex which is a treasure trove of useful info, very well written IMHO.
    and relatively simple to follow.

  3. ifelse
    Member
    Posted 9 years ago #

    This sounds like something that can be handled by Nick Momrick's recent posts plugin. The plugin takes in a number of parameters, two of which are the number of posts retrieved (1 i.e. the latest one) and whether or not you want a extract (abstract).

  4. Mark (podz)
    Support Maven
    Posted 9 years ago #

    I would use an rss function.

  5. Root
    Member
    Posted 9 years ago #

    Or a slug ? Excert thingy ?

  6. Jinsan
    Member
    Posted 9 years ago #

    This might be the thing you want:

    http://www.coffee2code.com/archives/2004/08/27/plugin-customizable-post-listings/

    This supports a multitude of options including the following tags:

    %post_content% // Full content of the post
    %post_date% // Date for post
    %post_excerpt% // Excerpt for post
    %post_excerpt_short% // Customizably shorter excerpt, suitable for sidebar usage

    You could install the plugin, and then place the code in your page template to have it display on your front page. Alternatively install RunPHP and then copy the code into the page that way.

    Should do the job though. So if I understand you correctly, everytime there is a new post, you want that little bit wherever the code is to automatically update itself to provide an extract of the most recent post.

  7. websage
    Member
    Posted 9 years ago #

    OK, I did what you had suggested: I uploaded the plugin, activated it, and then pasted the following

      Recently Commented
      <?php c2c_get_recently_commented(3); ?>

    into my test page:

    http://www.lawrencemmiller.com/blog.php

    See the error I get on the right-side column:

    Recent Posts
    Fatal error: Call to undefined function: c2c_get_recent_posts() in /home/lawre2/public_html/blog.php on line 103

    I am sure I am showing my total ignorance of PHP here but I would greatly appreciate anybody's help with this.

    Ideally, I would implement this code on the front page which currently is static HTML (I assume I will have to rename it into index.php).

    Thanks in advance!

    Mitko

  8. carthik
    Member
    Posted 9 years ago #

    I can offer some clues. I am sorry I can't try it out and tell you what absolutely works.

    Use the function query_posts (use http://www.cenamayo.com/wpxref to see how the function is written)

    Create a new query, something like
    $my_posts = query_posts();
    Then copy the loop over from the main loop, changing references to $posts with $my_posts , as needed.

  9. Kafkaesqui

    Posted 9 years ago #

    websage: make sure your page is WordPress-aware:

    http://wordpress.org/support/topic.php?id=29752#post-168054

    And yes, it would need to be .php-ized.

  10. carthik
    Member
    Posted 9 years ago #


    <?php $myposts =

    get_posts('numberposts=5');

    foreach ($myposts as $mypost) :

    start_wp();

    ?>

    <li><?php the_excerpt(); ?></li>

    <?php endforeach; ?>

    Should work in the sidebar, after you do what Kaf suggested above.

  11. websage
    Member
    Posted 9 years ago #

    Thank you so much! This is starting to work:

    http://lawrencemmiller.com/blog.php

    Now, how can I have just the excerpt of the latest entry posted on the front page?

    Thanks in advance!

  12. Joshua Sigar
    Member
    Posted 9 years ago #

    Have another block of code like right above your post, but instead set the numberposts to 1?

  13. websage
    Member
    Posted 9 years ago #

    Hmm, I did that but I do not get anything:

    http://lawrencemmiller.com/blog.php

  14. Ana
    Member
    Posted 9 years ago #

    I would like to do a similar thing - I need the date of the last *posted* (not necessarily last modified) post on a WAP hoempage.

    For instance:
    My blog (last update 10/04)

    I had a look at the plugin, but couldn't work out if it was what I needed or not.

    Can anyone help?

  15. Ana
    Member
    Posted 9 years ago #

    Please?

    I would give more information, but I don't know what else you need.

    If you let me know, I will provide it :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.