Different ID in every shortcode

What if you concatenate the string, like $author_ig = ‘[instagram-feed id=”‘ . get_the_author_meta(‘instagram’) . ‘” imageres=”full” showheader=”true” showbutton=”true” buttoncolor=”#fff” buttontextcolor=”#000″ showfollow=”false”]’; echo do_shortcode($author_ig); I used get_the_author_meta instead of the_author_meta, because the former returns the meta as a string while the latter echo’s the meta.

Multiple instances of the shortcode on the same page

I’d expect that the final return do_shortcode($return); is the problem as it tries to process a shortcode named the entire content you are about to return and return a value. I expect that this is not what you are intending there. Try changing that to: return $return; If that does not fix things, then I’d … Read more

WordPress Short code for List style

I finally make it ready after some more research. function coregnie_list_ul( $atts, $content = null ) { extract(shortcode_atts(array( ‘style’ => ‘cg_list’, ), $atts)); return ‘<ul class=cg_list_’.$style.’ >’.do_shortcode($content).'</ul>’; } add_shortcode(‘ul’, ‘coregnie_list_ul’); function coregnie_list_li( $atts, $content = null ) { return ‘<li>’.do_shortcode($content).'</li>’; } add_shortcode(‘li’, ‘coregnie_list_li’);

find shortcode inside content of post

In order to get your shortcode to show up, you have to register it first. This is done with add_shortcode(). You can read more about the Shortcode API in the Codex. Here is an example of a Youtube video-shortcode that accepts 3 parameters; Video ID (from Youtube, the last part of the Youtube url), height … Read more

Shortcode to return an image based on post taxonomy

There’s no need to replicate The Loop in your plugin; WordPress is working within a post when it processes a shortcode, so the post ID is available when the shortcode is being processed. Also, your arguments for has_term are out of order. And finally, it’s a best practice to make a shortcode all one word. … Read more