Skip to content

Instantly share code, notes, and snippets.

@grappler
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grappler/2a8abecfc739eadac56d to your computer and use it in GitHub Desktop.
Save grappler/2a8abecfc739eadac56d to your computer and use it in GitHub Desktop.
Extended mobile menu title for Responsive Mobile
<?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