Created
February 25, 2024 14:58
-
-
Save shameemreza/63690e8bd590296f51cb4a66448aaf1e to your computer and use it in GitHub Desktop.
Change Page Title for Woocommerce Shop Page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shop_title( $title ) { | |
if ( is_shop() && isset( $title['title'] ) ) { | |
$title['title'] = apply_filters( 'the_title', get_the_title( get_option( 'woocommerce_shop_page_id' ) ) ); | |
} | |
return $title; | |
} | |
add_filter( 'document_title_parts', 'shop_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment