-
Hi. I’ve been using RM for a while now and I really like it. Well done on all the hard work you’ve all put in.
Can you please assist me in where I’m going wrong? I have read this ticket https://support.rankmath.com/ticket/%E2%98%85-pre-fill-schema-fields-using-custom-fields/ and I’m trying to do it myself but it doesn’t seem to be working.
Do you know where I’ve gone wrong? My function code is below:
/** * Filter to change the schema data. * Replace $schmea_type with schema name like article, review, etc. * @param array $entity Snippet Data * @return array */ add_filter( 'rank_math/snippet/rich_snippet_JobPosting_entity', function( $entity ) { /* Here you would get the data from the custom fields and fill your schema */ $entity = array( 'jobLocation' => array( '@type' => 'Place', 'address' => array( '@type' => 'PostalAddress', 'streetAddress' => 'TEST Address', 'addressLocality' => ', Test Local', 'addressRegion' => 'Test Region', 'postalCode' => 'Test Post code', 'addressCountry' => 'UK', ), ), 'baseSalary' => array( '@type' => 'MonetaryAmount', 'currency' => 'USD', 'value' => array( '@type' => 'QuantitativeValue', 'value' => 40.00, 'unitText' => 'HOUR' ), ), ); return $entity; });
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The ticket ‘Auto fill schema fields with custom fields’ is closed to new replies.