I want to customize my WooCommerce child theme with parent theme Storefront. parent theme creates single product template (content-single.php)
/**
* @hooked storefront_post_header - 10
* @hooked storefront_post_meta - 20
* @hooked storefront_post_content - 30
*/
do_action( 'storefront_single_post' );
These functions are hooked to build out the page (/inc/structure/hooks.php)
add_action( 'storefront_single_post', 'storefront_post_header', 10 );
add_action( 'storefront_single_post', 'storefront_post_meta', 20 );
add_action( 'storefront_single_post', 'storefront_post_content', 30 );
this is the storefront_post_header function (inc/structure/post.php)
if ( ! function_exists( 'storefront_post_header' ) ) {
/**
* Display the post header with a link to the single post
* @since 1.0.0
*/
function storefront_post_header() { ?>
<header class="entry-header">
<?php
if ( is_single() ) {
storefront_posted_on();
the_title( '<h1 class="entry-title" itemprop="name headline">', '</h1>' );
} else {
if ( 'post' == get_post_type() ) {
storefront_posted_on();
}
the_title( sprintf( '<h1 class="entry-title" itemprop="name headline"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' );
}
?>
</header><!-- .entry-header -->
<?php
}
I need to output my function, storefront_post_header_categories (below), after storefront_post_header. I I was thinking to add the following to my child theme functions.php to do that
add_action( 'storefront_single_post', 'storefront_post_header_categories', 15 );
function storefront_post_header_categories() {
echo "code to display categories here";
}
It is not working and giving output anything to the front-end. Kindly help