"Titles & Meta" are not showing

This topic contains 17 replies, has 4 voices, and was last updated by  Kiran 4 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #537735

    Kiran
    Moderator
    Post count: 7069

    Hi Ralf,

    I guess it could be related to theme + user menus plugin. Try following PHP snippet.

    
    
    function gd_snippet_the_title( $title, $post_id = 0 ) {
    	if ( ! ( geodir_is_geodir_page() && GeoDir_Template_Loader::is_archive_page_id( $post_id ) ) ) {
    		return $title;
    	}
    
    	// Don't overwrite Yoast SEO or Rank Math SEO.
    	if ( GeoDir_SEO::yoast_enabled() || GeoDir_SEO::rank_math_enabled() ) {
    		return $title;
    	}
    
    	if ( ( geodir_is_page( 'post_type' ) || geodir_is_page( 'archive' ) ) && ( $_title = GeoDir_SEO::set_meta() ) ) {
    		$title = $_title;
    	}
    
    	return $title;
    }
    add_filter( 'the_title', 'gd_snippet_the_title', 20, 2 );

    Thanks,
    Kiran

    #538028

    Ralf
    Expired Member
    Post count: 35

    Hi Kiran,
    thank you! It is working on the test site but not on my productive site. I figured out that Yoast SEO is the reason why the productive site is not working with your snippet yet.
    When I disable Yoast in the GD settings (GD->settings->general->Titles&Meta, see screenshot) your snippet is working.

    Would you adjust the snippet so that it is working when Yoast is installed and not disabled in GD config?

    I’ve installed Yoast on the test site for you already.

    Best regards

    Ralf

    #538186

    Kiran
    Moderator
    Post count: 7069

    Hi Ralf,

    The snippet will only work if you have disabled using Yoast SEO from GD settings. GD has own SEO & Yoast also has own SEO. At one time you can use only one SEO for GD pages.

    Remove following lines from snippet to force using GD meta even Yoast SEO is not disabled.

    
    
    if ( GeoDir_SEO::yoast_enabled() || GeoDir_SEO::rank_math_enabled() ) {
    		return $title;
    	}

    Kiran

Viewing 3 posts - 16 through 18 (of 18 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount