Okay
  Public Ticket #3442149
try to change a template (event.php) in child theme but doesn't work ^^
Closed

Comments

  • Jess started the conversation

    Hi,

    I try to edit this file:

    Sonaar > Items > event.php

    I've copied the file in my child-theme, like described on top of it

    // you can modify this template by creating a file in your current theme : {THEMENAME}/sonaar-music/templates/event.php

    So I've put my file here:
    sonaar-child-theme/sonaar-music/templates/event.php

    When I'm edditing this file (in child-theme), nothing happens.
    I know that my code is correct, because when I copy-paste it in the original file (Sonaar > Items > event.php), it works perfectly...

    Here's the code I try to add:

    between 
    <div class="sr-it-event-date"> ..... </div>
    and
    <div class="sr_it-event-main">..... </div>

    I want to add

            <div class="event-featured-img-bbg">
                <?php
                if ( has_post_thumbnail() ) {
                    the_post_thumbnail('thumbnail');
                };
                ?>
            </div>       

    Because I need the featured-img to display on the event list
    (see result here: https://www.misterdelay.ch/agenda/)

    I think the problem comes from "where the event.php file is", in my child-theme.
    Are-you sure about the path?? ({THEMENAME}/sonaar-music/templates/event.php)

    Or do you have any idea why the file in my child-theme don't have any effect?

    Should I write something more in the functions.php file in my child-theme?

    Thanks in advance for your help 🤗

    Kind regards,
    Jess (webmaster of https://www.misterdelay.ch/)




  •  1,103

    Thanks,


    Max from the Sonaar.io Crew

  •   Jess replied privately
  •  1,103
    Max replied

    Hi,

    the path in the instruction code was wrong (will be fixed in the next theme update).

    put the event.php in sonaar-child/items/event.php


    Thanks,


    Max from the Sonaar.io Crew

  • Jess replied

    Great, it works!

    Thank you for your help  🤗

    Kind regards,
    Jess