Last active
August 29, 2015 14:10
-
-
Save grappler/2a8abecfc739eadac56d to your computer and use it in GitHub Desktop.
Extended mobile menu title for Responsive Mobile
This file contains hidden or 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
<?php | |
function responsive_extended_mobile_menu_title( $page_title ) { | |
if ( is_front_page() ) { | |
$page_title = __( 'Home', 'responsive-mobile' ); | |
} elseif ( is_home() ) { | |
$page_title = __( 'Blog', 'responsive-mobile' ); | |
} elseif ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) { | |
// @TODO Display porudct name on single product page | |
$page_title = woocommerce_page_title(); | |
} elseif ( is_archive() ) { | |
$page_title = responsive_mobile_archive_title(); | |
} elseif ( is_404() ) { | |
$page_title = __( 'Page not found', 'responsive-mobile' ); | |
} else { | |
$id = get_queried_object_id(); | |
$page_title = get_the_title( $id ); | |
} | |
return $page_title; | |
} | |
add_filter( 'responsive_mobile_menu_title', 'responsive_extended_mobile_menu_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment