Wodpress 4.1 - blogtitle missing from mp_tag and mp_category pages

This issue was addressed and fixed very kindly (see URL below), when title was set in header.php. With the advent of WordPress 4.1, our theme no longer sets the title in header.php, so we have again lost the company name in the page title of mp_tag and mp_category pages. I believe this modification must be put into a function using remove_filter and add_filter. I tried modifying the original fix for use in our functions.php to no avail.

Any assistance would be very much appreciated.

The original fix for the header.php is here:
https://premium.wpmudev.org/forums/topic/marketpress-blogtitle-missing-from-pagetitle#post-604728

Any tips or solutions would once again be greatly appreciated.

  • Patrick
    • Support Monkey

    Hi there @shelms1

    I hope you're well today!

    I see that my colleague @Vinod Dalvi had helped you out with this issue on that other thread. So I have tagged him on this one to get his invaluable input once again after the update.

    I believe he is currently in his working hours, so should be dropping in shortly after receiving notification of the tag. Hang in there, we'll get you up & running again. :slight_smile:

  • shelms1
    • Site Builder, Child of Zeus

    Thanks for your reply @Patrick.

    It seems no one has come forth with a solution to the problem. It may help to know that the issue --blogtitle missing from mp_tag and mp_category pages-- also appears in the new WordPress theme twentyfifteen.

    Any hints to the solution will be much appreciated!

  • Vinod Dalvi
    • WP Unicorn

    Hi @shelms1,

    With the advent of WordPress 4.1, our theme no longer sets the title in header.php

    Are you using the latest version 3.5.1 of the following Catch Box theme?

    http://catchthemes.com/themes/catch-box/

    If not then could you please send your theme on contact[at]wpmudev.org so that i can troubleshoot it?
    - Include my name in the subject "Vinod Dalvi"
    - Include the URL of this post in your message so that I may track this issue better

    Regards,
    Vinod Dalvi

  • shelms1
    • Site Builder, Child of Zeus

    Hello @Vinod,

    My apologies for the tardy response but I did not receive the expected notification of your reply.
    We are using the latest version of Catch Box which is now 3.5.3 .

    To clarify, WordPress DOES create the page title, so therefore there are now by default no <title> tags in header.php.

    The original fix for the problem that you so graciously provided us, was an edit to the <title> tag in header.php and so now another solution must be found.

    Right now I am including the header.php hack in the theme(child) in order to have the company name on MarketPress taxonomy pages and store/shopping-cart/ pages, but this results in two <title> tags in the <header> source code of every page of the site which is quite undesirable.

    Thanks again for your time and consideration.

    Best, Andy

  • Vinod Dalvi
    • WP Unicorn

    Hi Andy,

    Thank you for your reply.

    Would you mind if I logged in to your site and did some troubleshooting? This might help get to the bottom of this faster. If this is ok, just grant me temporary admin access to your site by clicking "Grant Access" button in the WPMU DEV Dashboard Settings as described on the following page and reply on this thread after granting it?

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Regards,
    Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi Andy,

    Thank you for granting the support staff access.

    Could you please try adding the following code in the functions.php file of your child theme and remove any changes made in the header.php file?

    remove_action( 'wp_head', 'catchbox_render_title' );
    
    function custom_catchbox_render_title() {
    ?>
    	<title><?php wp_title( '|', true, 'right' );
    	if( function_exists("mp_is_shop_page") && mp_is_shop_page() ){
    		$settings = get_option( 'mp_settings' );
    		global $post;
    		if($settings['slugs']['store'] != $post->post_name && !is_singular('product')){
    			// Add the blog name.
    			bloginfo( 'name' );
    		}
    	}
    ?></title>
    <?php
    }
    add_action( 'wp_head', 'custom_catchbox_render_title' );

    Best Regards,
    Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi Andy,

    Along with the previous code could you please try using the following code?

    add_action( 'after_setup_theme', 'remove_title_tag_from_child_theme', 11 );
    function remove_title_tag_from_child_theme() {
        remove_theme_support( 'title-tag' );
    }

    The end code will be as following.

    add_action( 'after_setup_theme', 'remove_title_tag_from_child_theme', 11 );
    function remove_title_tag_from_child_theme() {
        remove_theme_support( 'title-tag' );
    }
    
    remove_action( 'wp_head', 'catchbox_render_title' );
    
    function custom_catchbox_render_title() {
    ?>
    	<title><?php wp_title( '|', true, 'right' );
    	if( function_exists("mp_is_shop_page") && mp_is_shop_page() ){
    		$settings = get_option( 'mp_settings' );
    		global $post;
    		if($settings['slugs']['store'] != $post->post_name && !is_singular('product')){
    			// Add the blog name.
    			bloginfo( 'name' );
    		}
    	}
    ?></title>
    <?php
    }
    add_action( 'wp_head', 'custom_catchbox_render_title' );

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.