WordPress.org

Ready to get started?Download WordPress

Forums

List category posts
How to change date format? (6 posts)

  1. AcLime
    Member
    Posted 4 years ago #

    I red documentation and most of the threads in this forum but can't find out how you change date format. Mine always shows wordpress default.

    //Style for date:
    if($atts['date']=='yes'){
    $lcp_output .= '<td>' . get_the_time($atts['date_format'], $single).'</td>';
    }

    I don't understand how to config dateformat command and change it. Please help me, thank you.

  2. YukataNinja
    Member
    Posted 4 years ago #

    I have also noticed that dateformat is broken in .13. It worked at .12. Looking at a diff I think I see the problem. There is a new function lcp_showdate($single) that does the work to show the date. However, this function does not have access to the $atts variable that it tries to use. I assume this code was copied from the old spot. I have updated the function to the code below and updated the function calls to match the new parameter. This change works for me.

    function lcp_showdate($single, $atts){
    	return  ' - ' . get_the_time($atts['dateformat'], $single);//by Verex, great idea!
    }
  3. AcLime
    Member
    Posted 4 years ago #

    Thank you for help. I changed my template but It looks like theres more to change.

    I am getting error: Fatal error: Cannot redeclare lcp_showdate() (previously declared in /home/.../domains/.../public_html/.../wp-content/plugins/list-category-posts/list_cat_posts.php:170) in /home/.../domains/.../public_html/.../wp-content/themes/atahualpa/list-category-posts/docslist.php on line 50
    Can you tell me what is more needs to be changed?

  4. fernandobt
    Member
    Plugin Author

    Posted 4 years ago #

    Ooops, there was some refactoring on version 0.13 that broke the date. I'll fix it asap. Thanks!

  5. fernandobt
    Member
    Plugin Author

    Posted 4 years ago #

    AcLime, the change YukataNinja is talking about should be done on the plugin itself, not the template. You can do that as a temporary fix while I roll a new version with a fix for this.

    Thanks!

  6. AcLime
    Member
    Posted 4 years ago #

    When are you planning to release update? I really don't understand what YukataNinja said. I changed in list_cat_posts.php now but still don't work. Don't know where to change date format... If I change in template don't work, in list_cat_posts.php don't work...

    Please fix and release asap.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic