WPIntell

Source evidence

get function stops page render

Image Credits · support · 2013-09-13T16:10:00+00:00

mixedsentiment
mediumseverity
0.84relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 29 rows with source links

20.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

23 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
jeffreyd000 resolved
Hi, 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; .

Comments

4 shown
Adam Capriola 2013-09-25T15:24:00+00:00

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?

jeffreyd000 2013-09-25T17:50:00+00:00

I’ll give it a go. Thanks. Theme = Responsive from Cyberchimps

jeffreyd000 2013-09-25T18:22:00+00:00

Solved with <div class=”image-credits”><?php echo do_shortcode(“[image-credits]”); ?></div>

Adam Capriola 2013-09-25T21:54:00+00:00

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; .