• Resolved DigitalAccess

    (@memomx)


    I love this plugin it’s great
    I wish you could help me with this.
    I use a shortcode to put the dynamic year in the title and in the content of the questions, in general in the post.
    It was a bit complicated for me because at first glance it works fine, but looking at the source code the [shortcode] appears, not the year (2022)
    For the meta tags like title and description of the post I use the plugin dynamic-month-year-into-posts
    But for the schema, I don’t know how to make the [shortcode] not appear, but the year.
    I know that with filters like this
    –add_filter( ‘the_title’, ‘do_shortcode’ );
    It would work but I don’t have them from wpsso
    An example code is this:
    “name”: “All-Inclusive Vacation Packages [year]”
    I need it to be like this
    “name”: “All Inclusive Vacation Packages 2022”

    Thanks in advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter DigitalAccess

    (@memomx)

    Hi
    How long do you usually take to reply?

    Plugin Author JS Morisset

    (@jsmoriss)

    @memomx We generally reply to Premium tickets within a few hours, and check the free version forums on ww.wp.xz.cn every few days / weeks, as time permits.

    It sounds like you’re looking for ‘wpsso_the_title’ filter. See here for more info: https://wpsso.com/docs/plugins/wpsso/notes/developer/filters/

    Unfortunately WPSSO cannot use ‘the_title’ filter as most plugins/themes hooking into that filter cannot handle multiple/different post titles within the context of a multi-dimensional Schema JSON array (ie. for example, they often return the same title for different posts included within a single webpage Schema markup array). :-/

    js.

    Thread Starter DigitalAccess

    (@memomx)

    Thanks, @jsmoriss

    The problem is no longer running the shortcode on Titles or Content.
    In fact, as I commented, the dynamic-month-year-into-posts plugin does that or fixes it.
    The problem now is specifically in do shortcodes in the Open Graph (Facebook and Twitter) fields.
    and in the text of the schemas
    I know it can get complicated because WPSSO FAQ uses several posts but how can we solve that?
    It is not clear to me if WPSSO has a filter to be able to do that.
    Can you support me on that? an example or so

    This is part of the problem look at this
    <meta property=”og:title” content=”All Inclusive Packages [get_this_year] the smart decision”/>

    <meta name=”twitter:title” content=”All Inclusive Packages [get_this_year] the smart choice”/>`

    Plugin Author JS Morisset

    (@jsmoriss)

    As I said, hooking the ‘wpsso_the_title’ filter in your functions.php file should do the trick.

    Example:

    add_filter( 'wpsso_the_title', 'do_shortcode', 10, 1 );
    

    js.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Using shortcode in question title & body, schema fail’ is closed to new replies.