• Resolved fonnte

    (@fonnte)


    Hello,

    is it possible to make default title and description using variable?

    for example:

    1. post : how to [title] in [category]
    2. custom post type : Discount price of [title] on [custom_tax=”promo”]

    i am willing to migrate from yoast, yet my structure on yoast is as mentioned above

    • This topic was modified 4 years, 8 months ago by fonnte.
Viewing 1 replies (of 1 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi @fonnte ,

    The plugin support shortcodes for meta tags, so you can use it to enter manually in the Search Engine Optimization box.

    If you want to do for all posts, you can use the filter as described in the docs:

    add_filter( 'slim_seo_meta_title', function( $title ) {
        if ( is_singular( 'post' ) ) {
            $categories = get_the_category();
            $title = 'how to ' . get_the_title() . ' in ' . $categories[0]->name;
        } elseif ( is_singular() ) {
            $title = 'Discount price of ' . get_the_title() . ' on [custom_tax="promo"]';
        }
        return $title;
    } );

    (assuming your [custom_tax=”promo”] shortcode already works)

Viewing 1 replies (of 1 total)
  • The topic ‘variable on title/description’ is closed to new replies.