Hello sir,
Thank you so much for your suggestion on developing the shortcode. But, while trying to use the shortcode in JSON-Ld for developing rich snippets, the shortcodes are not convenient because of some rendering issues.
for example:
I used the following shortcode in {script....} JSON-LD for rich snippets in the RankMath Schema builder.
‘[rwmb_meta id=”single_image_dpce0q00wd5″ attribute=”url”]
After refresh (update), the value displays like the below:
`[rwmb_meta id=\”single_image_dpce0q00wd5\” attribute=\”url\”]
Also, I have tried your shortcode after activating the following code through code snippets and used the shortcode
'[single_image_url]
BUt there is no response.
'add_shortcode( 'single_image_url', function() {
$single_image = rwmb_meta( 'single_image_dpce0q00wd5' ); //replace your field ID here
if ( empty( $single_image ) ) {
return '';
}
$output = $single_image['full_url'];
return $output;
} );
If there is any mistake, please help me.
I have contacted RankMath for this issue. Awaiting their reply.
Meanwhile, they have suggested this option available (image attached) in ACF. Is there any way, we can call the url using custom field id?
https://1drv.ms/u/s!AjW7znckfYbzg9IWzGawSobPrAdB3g?e=xeE66J