automate a theme’s fields to display schemas in rank math

#194508
  • hello guys, i’m looking for a solution to an advanced question i’m trying to do with rank math. use a premium theme in wordpress or rehub. I want to automate fields of the theme or even the front code presented for users and bots. all my posts by default are products and I have a custom type for blog posts and separate information. with this I have been trying to automate the fields of the theme that they display: prices, freight, image, titles, descriptions. I’ve tried with the acf but I didn’t succeed. can you help me?

Viewing 1 replies (of 1 total)
  • Brian
    Rank Math free

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I think what you are talking about is more of the same thing as how WooCommerce fields are integrated with the WooCommerce Product schema. In your case here you want to integrate the schema into your theme fields if I got you right.

    For this, we would recommend getting in touch with your theme developer to help you include schema to the respective fields.

    You can hook into the following filter to extend the currently available schema with your custom attributes:

    /**
     * Collect data to output in JSON-LD.
     *
     * @param array  $unsigned An array of data to output in json-ld.
     * @param JsonLD $unsigned JsonLD instance.
     */
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	return [];
    }, 10, 2);

    Adding the code to your theme’s functions.php file will ensure that it does not get overwritten after a new plugin update.

    We really look forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘automate a theme’s fields to display schemas in rank math’ is closed to new replies.