Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wrdprssnerd

    (@wrdprssnerd)

    Hi it worked,

    i created my own action

    add_action( 'custom_product_name_title', 'custom_product_category_title', 6 );
    function custom_product_category_title(){
    	global $post;
    	$terms = get_the_terms( $post->ID, 'product_cat' );
    	$title = '';
    	foreach ($terms as $term) {
    	   $title = $term->name .' ';
    	}
    	echo "<span>".$title."</span>";
    }

    and added the new title.php:

    <h1 class="product_title entry-title">
    	<?php do_action( 'custom_product_name_title' ); ?><?php echo esc_html( get_the_title() ); ?>
    </h1>
    Thread Starter wrdprssnerd

    (@wrdprssnerd)

    Hi @ravivaddweb

    at first thank you, it kinda worked, but the hook seems not correct.
    I also tried woocommerce_before_single_product and woocommerce_before_single_product_summary. It always shows the category but not the title and the normal product-title is still there.

    regards

Viewing 2 replies - 1 through 2 (of 2 total)