Advertisement
lorro

WooCommerce - Change Shop page title

Jun 11th, 2015
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2.   // Change Shop page title
  3.   // code goes in functions.php for your child theme
  4.   // used for themes that use a product title for the shop page title
  5.   add_filter('post_type_archive_title', 'shop_page_title' );
  6.   function shop_page_title( $title ) {
  7.     if( $title == __('Products', 'woocommerce')) {
  8.       $shop_page_id = woocommerce_get_page_id( 'shop' );
  9.       $page_title = get_the_title( $shop_page_id );
  10.       return $page_title;
  11.     }
  12.     return $title;
  13.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement