WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding post date to recent-post plugin (9 posts)

  1. Daisyhead
    Member
    Posted 7 years ago #

    I am using the recent-post plugin and would like to add the date of each post prior to the link for the entry. I have tried tweaking the code on my own but no luck. Could anyone offer any help?

    Thanks!

  2. Daisyhead
    Member
    Posted 7 years ago #

    As an FYI, here's what I tried to do but I've been unable to get the date to pull for each entry. My additions are in bold:

    foreach ($posts as $post) {
    <b>$post_date = ($post_date);</b>
    $post_title = stripslashes($post->post_title);
    $permalink = get_permalink($post->ID);
    $output .= $before . '<b>. $post_date .</b> <a href="' . $permalink . '" rel="bookmark" title="Permanent Link: ' . htmlspecialchars($post_title, ENT_COMPAT) . '">' . htmlspecialchars($post_title) . '</a>';
    if($show_excerpts) {
    $post_excerpt = stripslashes($post->post_excerpt);
    $output.= '' . $post_excerpt;
    }
    $output .= $after;

  3. Daisyhead
    Member
    Posted 7 years ago #

    Anyone?

  4. moshu
    Member
    Posted 7 years ago #

    I am not familiar with that plugin.
    I am using this one:
    http://www.coffee2code.com/wp-plugins/#customizablepostlistings
    and it has the ability to display date by default.

  5. Daisyhead
    Member
    Posted 7 years ago #

    I've seen that other plugin but really didn't want to change as I like the MtDewVirus one. I was thinking there had to be an easy way to modify the code I'm already using to do what I want it to do. I mean, all it has to do is pull the date of the post and display it.

  6. KatGirl
    Member
    Posted 7 years ago #

    moshu's suggestion is pretty neat, if you want a no fuss plugin that gives you exactly what you want: date before the post title.

    However, if you download (c2c) and check the coding of their pull for date line, you may see how they do it and then you might be able to intergrate (copy & paste) that section of code into your code?

    I've learnt heaps from studying and copy&pasting code bits and pieces from templates, themes and plugins to get the right look and feel for what I want.

    Gotta confess I don't mind all that fiddling, either. Sometimes

  7. Daisyhead
    Member
    Posted 7 years ago #

    Thanks for the suggestion Kat! I think I will download the other plugin and take a look at it. If it does what I need it to do with minimal tweaking or fuss, then I suppose that's the better way to go.

    Normally I would take your advice and download the code and tweak the current plugin I have but I don't have the time to do that right now. (Dang 3 year olds and their petty demands anyway!) ;-)

    Thanks again!

  8. KatGirl
    Member
    Posted 7 years ago #

    I'm hearing you loud and clear :) Mine are 15 (turns 16 soon) and 21. All over bar the hooray!

  9. Daisyhead
    Member
    Posted 7 years ago #

    Well that plugin took a whole 3 minutes to upload and customize and I like it! Thanks for the info and the help Moshu and Kat!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.