I’ve read the WordPress codex and Googled for hours, but I can’t get the “get_post_class” to work in my shortcode.
I would like to convert this code into a shortcode valid code:
<div id="post-1027" <?php post_class('custom-class'); ?>>
At the moment I have this:
<div id="post-1027" ' . get_post_class('custom-class', $post->ID) . '>
But unfortunately this returns an empty class, instead of the complete post classes.
What am I doing wrong here?
Thanks in advance!
- The topic ‘get_post_class’ is closed to new replies.