Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28839

    Hello,

    I’d like to change to replace the date of the post in the Latest News widget by “Read More”.

    I found where I need to make the modification in class avia_newsbox and function widget

    Code:
    echo “<strong class=’news-headline’>”.get_the_title().”<span class=’news-time’>”.get_the_time($time_format).”</span>”;

    by

    Code:
    echo “<strong class=’news-headline’>”.get_the_title().”<span class=’news-time’>”.__(‘Read more’,’avia_framework’).”</span>”;

    But how can I put it in my child theme to make it upgrade friendly ? Can you tell me how I can put it in my functions.php for example ?

    Thanks in advance for your help.

    Basile

    #138805

    We wrapped all widget classes in a class_exists() function. This function makes sure that the child theme code can overwrite the parent class without triggering a php error. You just need to copy the entire “avia_newsbox” class into a child theme file (eg into functions.php or any other php file which you included with require_once() or include(). Then modify the class in your child theme and the parent theme will load the modified widget code instead of original parent theme code.

    #138806

    Excellent! Thx for your help!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘[Latest News Widget] Replace date by "Read More"’ is closed to new replies.