• Resolved phil31

    (@phil31)


    Hi,

    Right now we’re having an issue with the Title and Meta Description not updating on the page. Is there maybe a filter or a hook that I can use for the plugin that I can manually edit the Title and Meta Description? The way our theme is set up it doesn’t have a traditional header.php or else I would do some conditional logic for the specific page editing the title and meta description.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi Phil,

    There are many filters and hooks available, but I’m not sure you should be using them. I wasn’t able to find any “broken” pages standing out browsing your site.

    Do you have a direct link to the page(s) where you’re facing issues so that we can take a more pragmatic approach? Feel free to send the URLs over to me confidentially. Thank you!

    Thread Starter phil31

    (@phil31)

    Hi @cybr,

    Thank you reaching out. The link I sent you, the page isn’t broken, it’s that I cannot change the title and meta description for the link I sent you. That’s why I was curious if due to that particular page not allowing me to change the title and meta description what I should do.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Phil!

    Oh, now I see it. Oops, sorry! ??

    Yes, that’s a CPTA page, and we have yet to include custom field support for those. Adding input fields for CPTA is planned for TSF v4.1.0.

    Until then, I recommend using these filters:

    the_seo_framework_title_from_generation
    the_seo_framework_generated_description

    Here are the two examples tailored to your request (untested!), where you need to override My custom (title/description).

    add_filter( 'the_seo_framework_title_from_generation', function( $title, $args ) {
    
    	// CPTA won't be queried externally, anyway. Stop here.
    	if ( null !== $args ) return $title;
    
    	if ( is_post_type_archive( 'careers' ) ) {
    		$title = 'My custom title';
    	}
    
    	return $title;
    }, 10, 2 );
    
    add_filter( 'the_seo_framework_generated_description', function( $desc, $args ) {
    
    	// CPTA won't be queried externally, anyway. Stop here.
    	if ( null !== $args ) return $desc;
    
    	if ( is_post_type_archive( 'careers' ) ) {
    		$desc = 'My custom description';
    	}
    
    	return $desc;
    }, 10, 2 );

    Cheers ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Title and Meta Description do not show up’ is closed to new replies.