Title: PHP code to display Copyright manually
Last modified: December 6, 2017

---

# PHP code to display Copyright manually

 *  Resolved [phoenixsa07](https://wordpress.org/support/users/phoenixsa07/)
 * (@phoenixsa07)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-code-to-display-copyright-manually/)
 * Hello!
    I would like to display the copyright credits manually under the featured
   image. I have the following code in the file functions.php:
 * =================================
    //* Add featured image on single post add_action(‘
   genesis_entry_content’, ‘maker_featured_image’, 1 ); function maker_featured_image(){
 *  $add_single_image = get_theme_mod( ‘maker_single_image_setting’, true );
 *  $image = genesis_get_image( array(
    ‘format’ => ‘html’, ‘size’ => ‘featured-
   image-large’, ‘context’ => ”, ‘attr’ => array ( ‘alt’ => the_title_attribute(‘
   echo=0’ ), ‘class’ => ‘aligncenter’ ), ) );
 *  if ( is_singular() && ( true === $add_single_image ) ) {
    if ( $image ) { printf(‘
   <div class=”featured-image”>%s<div class=”featured-image-credits”><p class=”copyright-
   info”>’NEED CODE TO DISPLAY COPYRIGHT'</p></div></div>’, $image ); } } } ====
   =============================
 * Is there a way to do that using a simple php-code from Credit Tracker?
 * Thank you very much for your help!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [labs64](https://wordpress.org/support/users/labs64/)
 * (@labs64)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-code-to-display-copyright-manually/#post-9758676)
 * Hello [@phoenixsa07](https://wordpress.org/support/users/phoenixsa07/),
 * Yes, you can do this using standard Worpress shortcode call from the code:
 * `<?php echo do_shortcode( '[caption id="'.get_post_thumbnail_id( $post->ID ).'"]
   <p>%author%</p>[/caption]' ); ?>`
 * Best, Labs64
    -  This reply was modified 8 years, 5 months ago by [labs64](https://wordpress.org/support/users/labs64/).
 *  Thread Starter [phoenixsa07](https://wordpress.org/support/users/phoenixsa07/)
 * (@phoenixsa07)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-code-to-display-copyright-manually/#post-9764227)
 * Hi,
    thank you so much for your quick reply! I tried it with this code, but unfortunately
   a white page with an error message appears …. Can it be related to the fact that
   I use a Genesis Theme? or is not your code so easy to install in my above?
 * Thank you!!!
 *  Plugin Author [labs64](https://wordpress.org/support/users/labs64/)
 * (@labs64)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-code-to-display-copyright-manually/#post-9764736)
 * Hi [@phoenixsa07](https://wordpress.org/support/users/phoenixsa07/),
 * Actually, the theme shouldn’t be an issue in this case.
    May I ask you to provide
   exact error message from the webpage or possible from the log as well.
 *  Thread Starter [phoenixsa07](https://wordpress.org/support/users/phoenixsa07/)
 * (@phoenixsa07)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-code-to-display-copyright-manually/#post-9764795)
 * Hi!
 * I have inserted your code in mine:
 *     ```
       //* Add featured image on single post
       add_action( 'genesis_entry_content', 'maker_featured_image', 1 );
       function maker_featured_image() {
   
       	$add_single_image = get_theme_mod( 'maker_single_image_setting', true );
   
       	$image = genesis_get_image( array(
       			'format'  => 'html',
       			'size'    => 'featured-image-large',
       			'context' => '',
       			'attr'    => array ( 'alt' => the_title_attribute( 'echo=0' ), 'class' => 'aligncenter' ),
       		) );
   
       	if ( is_singular() && ( true === $add_single_image ) ) {
       		if ( $image ) {
       			printf( '<div class="featured-image">%s<div class="featured-image-credits">'<?php echo do_shortcode( '[caption id="'.get_post_thumbnail_id( $post->ID ).'"]<p>%author%</p>[/caption]' ); ?>'</div></div>', $image ); 
       		}
       	}
       }
       ```
   
 * then the following message appears:
 * Parse error: syntax error, unexpected ‘?’ in /www/htdocs/w00a8160/gesundheitsrebell_de/
   wp-content/themes/maker-pro/functions.php on line 281
 *  Plugin Author [labs64](https://wordpress.org/support/users/labs64/)
 * (@labs64)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-code-to-display-copyright-manually/#post-9765843)
 * Sorry, my bad – hab’ printf nicht gesehen 😉
 * Please replace your `printf` with this
 * printf( do_shortcode( '[caption id="'.get_post_thumbnail_id( $post->ID ).'"]%
   s[/caption]' ) , $image );

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PHP code to display Copyright manually’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/credit-tracker_e3e3a5.svg)
 * [Credit Tracker](https://wordpress.org/plugins/credit-tracker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/credit-tracker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/credit-tracker/)
 * [Active Topics](https://wordpress.org/support/plugin/credit-tracker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/credit-tracker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/credit-tracker/reviews/)

## Tags

 * [manually](https://wordpress.org/support/topic-tag/manually/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 5 replies
 * 2 participants
 * Last reply from: [labs64](https://wordpress.org/support/users/labs64/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/php-code-to-display-copyright-manually/#post-9765843)
 * Status: resolved