[Resolved] Replace the default Date icon with another SVG icon

Home Forums Support [Resolved] Replace the default Date icon with another SVG icon

Home Forums Support Replace the default Date icon with another SVG icon

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

    Hello,

    How can we change the default publish date/calendar icon? See the URLs provided in the Private section.

    Unfortunately, the date icon is not included in the custom code snippet to update various default icons, found at: https://docs.generatepress.com/article/generate_svg_icon_element/

    Tried to use the tu_add_to_post_date filter, per this article – https://docs.generatepress.com/article/generate_post_date_output/ – but it causes an error saying that filter has already been defined.

    Instead of the default calendar icon, we want to use this SVG icon instead:

    <svg aria-hidden="true" role="img" height="1em" width="1em" viewBox="0 0 448 512" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"></path></svg>

    Thanks!

    #2369224
    VR

    Ok, this is strange but NOW the snippet I added seems to be working okay. It did give a funky/crash type error initially, but now the default icon has been replaced properly and the error seems to have gone away. Marking “Resolved” – hopefully that’s all!

    #2369234
    Ying
    Staff
    Customer Support

    Glad it works 🙂

    Let us know if you need further help on this!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.