• Resolved tsigorai

    (@tsigorai)


    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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Have called the /wp-content/themes/hiero-child/inc/template-tags.php file from your child theme’s functions?

    Or you may want to try moving that code to child theme’s functions.

    Regards,
    Kharis

    Thread Starter tsigorai

    (@tsigorai)

    The code wasn’t in the child theme’s function.php file. Moving it to that file fixed the issue. Thanks.

    You’re welcome!

    Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

    Regards,
    Kharis

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘No changes visible when editing child theme’s template-tags.php’ is closed to new replies.