I've created a post type name "Gallery" and added some post meta boxes to it. For now, let's say there is a Title and a Content for each single gallery.
now, I want to make a use of that data with Shortcode. How Is this possible?
For example -
[gallery id=x]
I know how to take the value of ID (x), but how do I output a post with the ID of that value?
I register this shortcode like so (but of course it's not completed)
function shortcote_gallery( $atts , $content = null ) {
extract( shortcode_atts(
array(
'title' => 'Default Gallery Title'
), $
return "<h3>$title</h3><p>$content</p>";
}
add_shortcode( 'gallery', 'shortcote_gallery' );
I hope I was clear enough. If not, please let me know so I explain myself better. Thanks in advance.