Support » Plugins and Hacks » [Resolved] Add date beside post title

[Resolved] Add date beside post title

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ajay



    Appreciate if you could wrap your code above in code tags. Am a bit confused on what exactly you’re changing.

    I’ve tried three codes below:
    $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>';

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

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

    Plugin Author Ajay


    You need to modify the plugin and add the code before line 126 of https://plugins.trac.wordpress.org/browser/contextual-related-posts/trunk/contextual-related-posts.php

    $output .= '<span class="crp_date"> '.mysql2date("d/m/y", $result->post_date).'</span>';

    However, please note that it is not recommended to modify the plugin files directly since it will most likely break in the next upgrade

    Thanks for your help. I tried to add your code but the date still not showing.

    Plugin Author Ajay


    You also need to add this code

    $result = get_post($result->ID);

    after this on line 101

    foreach($results as $result) {

    Works like charm 🙂 Thank you so much.

    Plugin Author Ajay


    You’re welcome. I’ve put the date showing in my list of things to add to the plugin. So, the next time around you should be able to upgrade and turn the option on.

    Plugin Author Ajay


    This has been implemented the date feature in v1.8.8 that I released today. You choose to tick or untick this display in the Settings page

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Add date beside post title’ is closed to new replies.