• I wanted a bit of excerpt text on the comments widget on a site where I am using a child theme of Chaplin, but the widgets are set up as to not allow overrides in a child theme. From functions.php

    If

    require_once( get_template_directory() . '/parts/widgets/recent-comments.php' );
    require_once( get_template_directory() . '/parts/widgets/recent-posts.php' );

    were replaced with

    require_once( get_stylesheet_directory() . '/parts/widgets/recent-comments.php' );
    require_once( get_stylesheet_directory() . '/parts/widgets/recent-posts.php' );

    I think would do it. As is, I had to put a new set up widget setup includes and functions to reference the template in my child theme.

    FWIW my update was changing in /parts/widgets/recent-comments.php from

    <p class="meta color-secondary"><?php echo wp_kses_post( get_comment_date( get_option( 'date_format' ) ) ); ?></p>

    to

    <p class="meta color-secondary"><?php echo wp_kses_post( get_comment_date( get_option( 'date_format' ) ) ); ?> "<?php echo wp_trim_words( $comment->comment_content, 15, '...' ); ?>"</p>

  • The topic ‘Child Theming Widgets’ is closed to new replies.