No changes visible when editing child theme’s template-tags.php
-
I have been trying to remove the post metadata that displays the author of a blog post in the hiero theme. I have located the file which contains the below code (athemes_posted_on() function) that outputs the author’s name under /wp-content/themes/hiero/inc/template-tags.php:
if ( ! function_exists( 'athemes_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. */ function athemes_posted_on() { $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); printf( __( '<span class="posted-on">Posted on %1$s</span><span class="byline"> by %2$s</span>', 'hiero' ), sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>', esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string ), sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'hiero' ), get_the_author() ) ), esc_html( get_the_author() ) ) ); } endif;
I copied the parent hiero theme’s template-tags.php to the following path (/wp-content/themes/hiero-child/inc/template-tags.php) under a hiero child theme I created. Next, I deleted the code that outputs the author name in the athemes_posted_on() function. Despite making these changes, I don’t see any changes when I display the blog post and it seems that the parent theme’s template-tags.php is taking precedence over the child theme’s template-tags.php. Do I need to make any additional changes to address this issue?
- The topic ‘No changes visible when editing child theme’s template-tags.php’ is closed to new replies.