Hello,
We’re trying to place a shortcode inside the profile tab.
The problem is that we need to place the title of the listing as Tag inside the shortcode.
We were using this code before the Geodir V2 and was working
<?php $meta_value = geodir_get_post_meta($post->ID, 'geodir_professional_name', true ); ?>
<?php if (!empty( $meta_value )): ?>
<?php echo do_shortcode('[newsbox style="nb6" display="tag" tag="'.geodir_get_post_meta($post->ID, 'geodir_professional_name', true).'" number_of_posts="3" title="Latest News"]'); ?>
<?php endif; ?>
And now with the new version that allows to add shortcode inside the profile tab, we’re trying to create a shortcode with the variable picking up the Listing name. But it doesn’t seem to be working now. (If we use this code without the variable of ‘geodir_get_post_meta()’ and place a tag, then it works. So the problem is with that)
function LatestNewsShortcode() {
return do_shortcode('[newsbox style="nb6" display="tag" tag="'.geodir_get_post_meta($post->ID, 'post_title', true).'" number_of_posts="3" title="Latest News"]');
}
add_shortcode('latest-news', 'LatestNewsShortcode');