Tagged: , ,

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #222519

    Hello:

    I would like to hide just the time in the date/time output of the Posts widget.

    I have found the following code in /framework/php/class-framework-widgets.php

    echo "<span class='news-time'>".get_the_time($time_format)."</span>";

    But am not sure what format I should pass instead of $time_format, or indeed if I can add this file to my child theme and hope to make it work.

    Mainly I’m comfortable in HTML/CSS, less so in PHP.

    Thanks

    #222530

    Hi!

    Replace

    echo "<span class='news-time'>".get_the_time($time_format)."</span>";
    

    By this:

    echo "";
    

    Regards,
    Josue

    #227492

    Hey!

    Any clue how can i do this in my Enfold child theme?

    Thanks,

    Rhodo

    #227497

    Hi!

    You can moify class-framework-widgets.php file and paste it in /framework/php/ folder in your child theme

    Cheers!
    Yigit

    #227508

    Thanks Yigit!

    But now i actually see that the the main question isnt answered properly:

    from this line: <span class='news-time'>".get_the_time($time_format)."</span>
    How can i just remove the time.
    so: 21 februari 2014 – 15:08 becomes –> 21 februari 2014?

    Even if i remove the code like Josue says and edit it in the child theme placed file like you suggested it still shows up?!

    Any idea?

    #227573

    Hi!

    Please change

    .get_the_time($time_format).

    to

    .get_the_date().

    Regards,
    Yigit

    #231102

    Dear Yigit,

    Thanks this code works but only in the main Enfold theme. How can i do this in the child theme?

    Your answer:

    You can modify class-framework-widgets.php file and paste it in /framework/php/ folder in your child theme

    Doesn’t work.

    Rhodo

    #231137

    I second Rhodo’s point…I tried putting my copy of this file in the same structure in my child theme and none of the changes work. I have to keep updating the parent theme version. Is this a change to how WP handles the ordering in child themes? The docs on the WordPress codex are a bit arcane for anything that isn’t strictly page templates or css.

    #232102

    Hi!

    Use this filter code and add it to the bottom of your child themes functions.php to change the date/time format:

    
    function change_avia_date_format($date, $function) {
      if(!empty($function) && $function != 'avia_get_comment_list') $date = get_option('date_format');
      return $date;
    }
    add_filter('avia_widget_time', 'change_avia_date_format', 10, 2);
    

    The code will remove the time and return the date only.

    Regards,
    Peter

    #232149

    Thanks a lot Peter! That solved it :-)

    #232160

    Hey!

    Great :)

    Regards,
    Peter

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.