WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Related Posts
Add date beside post title (21 posts)

  1. anhtuan020588
    Member
    Posted 1 year ago #

    Hello,

    I want to add date beside post title (screenshot: http://img20.imageshack.us/img20/3091/418201321020pm.jpg) by using this code: $output .= '<label style="color:#888888;font-size:11px;padding-top:2px;font-style:italic;"> (' . date_format(date_create($search->post_date),"d/m/Y") . ') </label>';

    Where is extactly location should i add that code?

    Thank you.

    http://wordpress.org/extend/plugins/wordpress-23-related-posts-plugin/

  2. silvoslaf
    Member
    Plugin Author

    Posted 1 year ago #

    Hey!

    Why don't you just enable the box next to the "Display Publish Date " option in your plugin settings? Here's a screenshot for easier navigation: https://www.diigo.com/item/image/3v5jq/iycq

    Let me know if you had this or something else in mind. Also — if you would like to change how the date looks like, send us the link to the blogpost in question and I'm sure we'll be able to customize it via the CSS code.

    Take care & I'm looking forward to your reply!

    Best,
    Silvo

  3. anhtuan020588
    Member
    Posted 12 months ago #

    Thanks Silvo. Because i want my custom date behind post title, hence i just want to know where is extactly location i should to add that code.

    The date should be look like this: http://www.hivietnam.net/vi/04/2013/ve-dep-pho-nui/

  4. silvoslaf
    Member
    Plugin Author

    Posted 12 months ago #

    Hey!

    Sorry for not getting back to you earlier, but we finally managed to "solve your problem"! :)

    Here's the deal — go to your WordPress's Dashboard under the tab 'Plugins'-'Editor' and select our plugin ("WordPress Related Posts") to edit (in the top right corner of your screen).

    Now, find the following code (it should be in the 270th line):

    $output .= '<a href="' . $post_url . '" class="wp_rp_title">' . wptexturize($related_post->post_title) . '</a>';

    After this line of code paste the one from above; so now it should look something like this:

    $output .= '<a href="' . $post_url . '" class="wp_rp_title">' . wptexturize($related_post->post_title) . '</a>';
    $output .= '<label style="color:#888888;font-size:11px;padding-top:2px;font-style:italic;"> (' . date_format(date_create($related_post->post_date),"d/m/Y") . ') </label>';

    We also recommend that you change <label> into <span>.

    Either way — do let me know how it goes or if you need any further assistance. I'll gladly help! :)

    Take care & have a nice day!

    Best,
    Silvo

  5. anhtuan020588
    Member
    Posted 12 months ago #

    Perfect. Thanks brother :)

  6. silvoslaf
    Member
    Plugin Author

    Posted 12 months ago #

    You're welcome, glad it worked out for you! :)

    You are always welcome to leave a vote or a review about us on our plugin page on the WordPress website, if you find the time. It shouldn't take you more than a minute (two, if you write something nice)! :)

    As always — if you have any questions or if you stumble upon any problems, do not hesitate to let us know! We'll gladly help!

    Take care & have a nice day!

    Best,
    Silvo

  7. anhtuan020588
    Member
    Posted 11 months ago #

    Hi again,

    I have another issue after update to newest version.

    My code: $output .= '<label style="color:#888888;font-size:11px;padding-top:2px;font-style:italic;"> (' . date_format(date_create($related_post->post_date),"d/m/Y") . ') </label>'; does not display date based on post_date anymore, it's just display today.

    Could you please help me check it? My URL: http://www.nhadep.net/vi/12/2012/18-kieu-phong-khach-hien-dai/

    Thank you.

  8. silvoslaf
    Member
    Plugin Author

    Posted 11 months ago #

    Hey!

    Try with the code below and let me know if it helped you out in any way:

    $output .= '<label style="color:#888888;font-size:11px;padding-top:2px;font-style:italic;"> (' . mysql2date("d/m/Y", $related_post->post_date) . ') </label>';

    Take care & let us know how it goes!

    Best,
    Silvo

  9. anhtuan020588
    Member
    Posted 11 months ago #

    It's not works Silvo. Could we try another code?

  10. silvoslaf
    Member
    Plugin Author

    Posted 11 months ago #

    Hm, we have no idea what could be wrong. Can you try the following code?

    $output .= '<label style="color:#888888;font-size:11px;padding-top:2px;font-style:italic;"> (' . $related_post->post_date . ') </label>';

    Let us know how it goes!

  11. anhtuan020588
    Member
    Posted 11 months ago #

    Still the same. I give up :(

  12. silvoslaf
    Member
    Plugin Author

    Posted 11 months ago #

    Hey!

    We took another look at your blog (http://www.nhadep.net/vi/12/2012/18-kieu-phong-khach-hien-dai/) and noticed that you have to sections of related posts under your blogposts — one of which is ours and the second one which is not.

    Correct me if I'm mistaken, but the second one (the one with the false date problem) is not our ("WordPress Related Posts") plugin — can you confirm this?

    Here's a screenshot of what we are seeing: http://cl.ly/image/162l2y1V0R2I

    Please let me know if this is the case or if I'm missing something out. I'll gladly help! :)

    Take care!

    Best,
    Silvo

  13. anhtuan020588
    Member
    Posted 11 months ago #

    Yes, you're correct. I think this is extactly the issue Silvo :(

  14. silvoslaf
    Member
    Plugin Author

    Posted 11 months ago #

    What's the name of that other related posts plugin (the one that's not ours)? Have you tried to contact their team for help?

    Let us know and we'll try to help you out! Take care!

  15. anhtuan020588
    Member
    Posted 11 months ago #

    Thanks Silvo. Please cover me if they don't help me out :( I'm using another plugin is: Contextual Related Posts.

  16. silvoslaf
    Member
    Plugin Author

    Posted 11 months ago #

    Hey!

    Hope you don't mind us asking, but we were wondering why having two sections of related posts, if you could just increase the number of related posts in our plugin settings? This way the dates would show up correctly. :)

    (We know this is none of our business, so you can easily ignore our previous question.) :)

    But if you would like to keep the same look you already have in your blogposts (two separated sections of related posts), then we would strongly recommend you to install our other plugin called 'Related Posts by Zemanta'. It's basically the same one as this one you are already using, but if you use the same CSS code as you did before, you could have the same look you already have, just that the dates would show up correctly.

    Let me know if you have any questions or if you need any assistance — I'll gladly help!

    Take care & have a nice day!

  17. anhtuan020588
    Member
    Posted 11 months ago #

    You know, i added two related posts because i want to display two parts different content of related. So, everyone will have more choice of related posts :)

    1: Based on similar contents and title.

    2: Random posts.

    I tried both of your plugins but it's just display related posts.

    If you have "Random Option" at your next update version will be cool. I will using "WordPress related posts" for related posts and "Related Posts by Zemanta" for random posts. I think this is necessary for another customers of Zemanta like me :)

  18. silvoslaf
    Member
    Plugin Author

    Posted 11 months ago #

    Yes, I understand & agree with you completely! And we appreciate feedback like this, really!

    But for now we are just not able to help you out on this. Our plugins are only able to display posts that are related and that option with only random ones is just not our horizon yet. We hope we'll be able to implement it sometime in the future, but I really cannot give you any certain dates. We're really sorry about this!

    As always — if you have any questions or if you stumble upon any problems (let's hope not, though!), do not hesitate to let us know! We'll gladly help!

    Take care!

    Silvo

  19. anhtuan020588
    Member
    Posted 2 weeks ago #

    Hi Silvo,

    Long time no talk. How are you?

    I need your help to config the code work again with your newest version. After updated to version 3.3.3 i can not find the title code "$output .= '' . wptexturize($related_post->post_title) . '';" so i can not add date after.

    Could you please help me take a look?

    Thank you,
    Tuan.

  20. PetraP
    Member
    Plugin Author

    Posted 2 weeks ago #

    Hey Tuan,

    I hope you don't mind me answering on Silvo's behalf and big sorry for the late reply.
    You can find the code in init.php (lines 286-290) file:

    if ($platform_options["display_publish_date"]) {
                $dateformat = get_option('date_format');
                $output .= '<small class="wp_rp_publish_date">' . mysql2date($dateformat, $related_post->post_date) . '</small> ';
                //$output .= mysql2date($dateformat, $related_post->post_date) . " -- ";
            }

    However we are going to release a new version of the plugin any day now so I suggest you wait for it and we can fix any date issues at that time.
    Either way - please let me know how it goes or if you need any further assistance. I'll gladly help! :)

    Take care & have a nice day!

    Best,
    Petra

  21. anhtuan020588
    Member
    Posted 2 weeks ago #

    Thank you for your reply Petra.

    I will waiting for your new release :) Beside that, if you can add cutom css for the date, then i don't have to add custom code manually everytime when i updated the plugin :)

    Have a nice day,
    Tuan.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags