Hello Naveen,
I have recover this piece of code which includes the woocommerce shopping cart icon in the header :
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
$count = WC()->cart->cart_contents_count;
?>cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php
if ( $count > 0 ) {
?>
<span class="cart-contents-count"><?php echo esc_html( $count ); ?></span>
<?php
}
?><?php
I place it in the Directory Starter HMTL (header) and it is working well. Now to prevent this piece of code to disappear when Theme will update, I would like to move the function into a PHP Snippet.
function my_icon_in_header() {
...
}
add_action( 'directory_starter_header', 'my_icon_in_header' );
Do Directory Starter header has a hook like do_action( ‘directory_starter_header’ ); ?