Profile cover photo
Profile photo
Rocking Aryan
29 followers -
An entrepreneur Internet Marketer, Search Engine Optimizer and Addicted Blogger from India.
An entrepreneur Internet Marketer, Search Engine Optimizer and Addicted Blogger from India.

29 followers
About
Posts

Post has attachment
Add a comment...

Hi,
I want to create a shortcode to get featured image from the current post in Genesis child theme. Like the default shortcodes [post_categories] [post_tags]

I am using this code and it is output is %s after adding [genesis_get_image]

OUTPUT
<div class="image"><img src="%s" alt="%s"></div>

CODE
//* shortcode to output featured image
function featured_image() {
if ( $image = genesis_get_image( 'format=url&size=portfolio' ) ) {
return '<div class="image"><img src="%s" alt="%s" /></div>';
}
}
add_shortcode('genesis_get_image', 'featured_image');


Looking for your help to fix this code or share a working code for this :)

Post has attachment
Add a comment...

Post has attachment

Post has attachment
About
About
blogtipstricks.com
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Blogging resources for new bloggers
#blogging_resources
#blogging_toolbox
#blogging_tools
BlogTipsTricks
BlogTipsTricks
blogtipstricks.com
Add a comment...

Post has attachment
Add a comment...

Post has attachment
How to Change Sitemap frequency in WordPress SEO by Yoast Plugin
#change_sitemap_frequency
#yoast_xml_sitemap  
#xml_sitemap  
#change_sitemap_priority  
Add a comment...
Wait while more posts are being loaded