Viewing 3 posts - 16 through 18 (of 18 total)
  • Posted in: Dante
  • #110779
    alemarengo
    Member
    Post count: 695

    Finally found!
    I had this piece of code:

    add_filter('woocommerce_page_title', 'custom_woocommerce_page_title');
    function custom_woocommerce_page_title( $page_title ) {
      if( $page_title == 'Shop' ) {
        return "Punto Bianco - Shop online";
      }
    }

    I wanted to use to set to the Shop page a different title. The point is that Shop has a title, but other pages not. How can I fix in order not to affect other pages’ title?

      else if  ( $page_title != 'Shop' ){
        return $page_title
      }

    Waiting for your hint!
    And many thanks for your support. I couldn’t find it without you!

    #110784
    alemarengo
    Member
    Post count: 695

    Ok, for those out there that could have experienced the same issue or simply wanted to customize both Shop page title and archive pages’ ones here’s the right snippet:

    add_filter( 'woocommerce_page_title', 'title_for_shop' );
    function title_for_shop( $title )
    {
      if ( is_shop() ) {
        return __( 'name of your shop page' );
      }
      return $title;
    }
    

    Thanks Kyle once again!

    #111019
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Thanks for sharing the snippet.
    With Best Regards
    Mohammad

Viewing 3 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic.