• Hi
    In the backend it says: This name will be shown on the website.
    How come, that this never happens?
    The dom says: <h1 class=”page-title”></h1>
    Any idea?
    regards
    theo

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter timholz

    (@timholz)

    I found the cause:

    //change shop title to something else
    add_filter( 'woocommerce_page_title','my_shop_title');
    function my_shop_title( $page_title){
    	if ( 'Shop' == $page_title) {
    		return "custom name";
    	}
    }

    somehow this wipes off the categroy page title.

    To have something happen on only certain pages, you can use conditionals:
    https://docs.woocommerce.com/document/conditional-tags/

    So if you want to leave category pages alone, your function becomes:

    // change shop title to something else
    add_filter( 'woocommerce_page_title', 'my_shop_title' );
    function my_shop_title( $page_title){
      if ( 'Shop' == $page_title && !is_product_category() ) {
        return "custom name";
      }
      return $page_title;
    }
    
    Thread Starter timholz

    (@timholz)

    @lorro
    Hi
    Great. Thanks a lot for this hint.
    regards
    theo

    works well, thank you very much.

    • This reply was modified 7 years, 11 months ago by timholz.
    • This reply was modified 7 years, 11 months ago by timholz.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘category page title not showing’ is closed to new replies.