Conversation
supportHi, I just installed the plugin, great idea! I want to have the credit show below the featured image. I edited single.php to include: <?php get_image_credits(); ?> When I check the site the page stops rendering right where that is supposed to show up. Do I have a syntax error? Do I need to leave the functions call in functions.php for the plugin to work? BTW: The plugin did work when I only had the code in functions.php but it was just too low on the page. Right below the featured image is the sweet spot!. Thanks, Jeffrey http://wordpress.org/plugins/image-credits/
get_image_credits() only returns the image credits, so you might need to do echo get_image_credits(); . If that doesn’t work, then I might have an idea as to why it’s stopping the page render. What theme are you using by the way?
I’ll give it a go. Thanks. Theme = Responsive from Cyberchimps
Solved with <div class=”image-credits”><?php echo do_shortcode(“[image-credits]”); ?></div>
Great! I’m still not quite sure why the page stopped rendering, but I’m happy you got it working. Normally I filter the the_content to add the image credits like this: /** * Image Credits on Posts * */ add_filter( 'the_content', 'ac_image_credits' ); function ac_image_credits( $content ) { if ( is_singular( 'post' ) ) { $content .= '<p>[image-credits]</p>'; } return $content; } That adds the credits to the end of a post. If you wanted them at the beginning, you could do $content = '<p>[image-credits]</p>' . $content; .
get_image_credits() only returns the image credits, so you might need to do echo get_image_credits(); . If that doesn’t work, then I might have an idea as to why it’s stopping the page render. What theme are you using by the way?
I’ll give it a go. Thanks. Theme = Responsive from Cyberchimps
Solved with <div class=”image-credits”><?php echo do_shortcode(“[image-credits]”); ?></div>
Great! I’m still not quite sure why the page stopped rendering, but I’m happy you got it working. Normally I filter the the_content to add the image credits like this: /** * Image Credits on Posts * */ add_filter( 'the_content', 'ac_image_credits' ); function ac_image_credits( $content ) { if ( is_singular( 'post' ) ) { $content .= '<p>[image-credits]</p>'; } return $content; } That adds the credits to the end of a post. If you wanted them at the beginning, you could do $content = '<p>[image-credits]</p>' . $content; .