Where to put This_Week.php in Child Theme?

Home Forums Calendar Products Events Calendar PRO Where to put This_Week.php in Child Theme?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1122060
    Christopher
    Participant

    Hello!

    I had to do some modification in This_Week.php (../wp-content/plugins/events-calendar-pro/src/Tribe/This_Week.php) in order to change the output of date and time in this-week-widget.

    But I can’t find a effective place, where to put it in my child theme, though having studied the Themer’s Guide.

    Maybe you can give me a hint.

    Thanks in advance!

    Christopher

    #1122122
    Cliff
    Member

    Hi Christopher.

    Thanks for your question.

    If you’re trying to customize the This Week widget, you’re modifying the wrong file.

    For the files that can be overridden via the Themer’s Guide (the templating system), they have a comment in the top of the file.

    For example: /wp-content/plugins/events-calendar-pro/src/views/pro/widgets/this-week/single-event.php says “Override this template in your own theme by creating a file at [your-theme]/tribe-events/pro/widgets/this-week/single-event.php”

    Please let me know if this solves your issue.

    #1122196
    Christopher
    Participant

    Hello Cliff!

    Thanks for your reply!

    The point is, that I copied all files as indicated in the Themer’s Guide to a folder in my child theme, regarding the widget. But: The output of the format of the date in the header of the widget can’t be controlled in the templates you refer to, in this case loop-grid-day.php, where I find the code:

    <div class=”tribe-this-week-widget-header-date”>
    <span class=”day”><?php echo esc_html( $day[‘formatted_day’] ); ?></span>
    <span class=”date”><?php echo esc_html( $day[‘formatted_date’] ); ?></span>
    </div>

    My trials to change the date format here failed. But I found out, I could change them in the mentioned This_Week.php.

    Or do I miss something?

    Or may I conclude from your response, that there is no smooth way to change the time format in the widget via modifying this file in the folder of my child theme?

    Christopher

    #1123048
    Cliff
    Member

    Since the file you’re trying to modify is not part of our templating system, you’d need to resort to typical PHP classes (e.g. extending the class). If you don’t know how to do this, you’ll either need to stay within the confines of customizing within our templating system or get help from a developer.

    I believe you should be able to do everything you need in the templating system, though.

    If needed, feel free to reference our list of known customizers.

    #1129914
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Where to put This_Week.php in Child Theme?’ is closed to new replies.