• Resolved josh.grisdale

    (@joshgrisdale)


    Hello! I love your plugin. πŸ™‚

    Right now, the meta title is “For single page or post: Page/Post title – Site title” according to the FAQ.

    Is there a way to change it so a single post of a specific CPT is “[Something extra] Post title – Site title”? I know I could go and change each one individually, but there are hundreds….

    Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi @joshgrisdale ,

    Yes, you can use a snippet to insert text into the meta title, like this:

    add_filter( 'slim_seo_meta_title', function( $title, $object_id ) {
    if ( get_post_type( $object_id ) === 'movie' ) {
    $title = 'Something ' . $title;
    }
    return $title;
    }, 10, 2 );

    For more examples, please see the docs.

    • This reply was modified 1 year, 12 months ago by Anh Tran.
    Thread Starter josh.grisdale

    (@joshgrisdale)

    Thank you

    Sorry, I made a mistake, not the meta title, but <title>

    Plugin Author Anh Tran

    (@rilwis)

    Yes, that’s what I meant. Meta title = the content in the <title> tag.

    Thread Starter josh.grisdale

    (@joshgrisdale)

    Ok, then it isn’t working… πŸ™

    Is there a way to directly contact support?

    Plugin Author Anh Tran

    (@rilwis)

    Did you change the “movie” in the snippet above to your CPT slug?

    You can also contact and share us a temporarly login via our contact form.

    Thread Starter josh.grisdale

    (@joshgrisdale)

    Before I do the contact form, please see this page:
    https://www.accessible-japan.com/places/japan/mie/shima/attractions/ama-hut-satoumian/

    I want the title that shows up in the tab to be “Ama Hut Satoumian Accessibility Information – Accessible Japan” (I want to insert “Accessibility Information” after the current title).

    I have it working for og:title… but not <title>

    add_filter( 'slim_seo_meta_title', function( $title, $object_id ) {
    if (is_singular('gd_place')) {
    $post_title = get_the_title();
    $site_name = get_bloginfo('name');


    $title = $post_title. ' Accessibility information - ' .$site_name;
    }

    return $title;
    }, 10, 2 );
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Change meta title for specific post type’ is closed to new replies.