• Resolved waldenweb

    (@waldenweb)


    Is there a way to prevent the credit from showing if I don’t enter a value in the credit field? It is showing the user who uploaded the image if I don’t specify a value in the credit field.

    I’ve added some custom code in my template to display the credit and will want to hide that as well if there is no content enter by the user in the credit field.

    Mostly the user entering content is not the photographer.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author pepe

    (@pputzer)

    The option Do not display default credit. does exactly that.

    Thread Starter waldenweb

    (@waldenweb)

    I tried that and it prevented the author name from being prepopulated in the media form, but it didn’t stop it from showing on the front end if nothing is entered in the credit field.

    Plugin Author pepe

    (@pputzer)

    That’s weird. What are your other settings? Which theme? (I’m assuming you have not manually integrated Media Credit into the theme templates.)

    • This reply was modified 7 years, 8 months ago by pepe.
    Thread Starter waldenweb

    (@waldenweb)

    It’s a custom theme where I have integrated it into the template:
    `
    $img_id = get_post_thumbnail_id( $this->pid );
    $img_credit = get_media_credit_html($img_id);

    Display credit for featured images is checked (it is a featured image)
    Do not display default credit is checked

    Plugin Author pepe

    (@pputzer)

    Ah! In that case you have to do the option checking yourself, too – or simply add false as the second parameter to the get_media_credit_html call.

    Thread Starter waldenweb

    (@waldenweb)

    awesome, that works! Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Prevent credit from displaying if no credit is entered by user’ is closed to new replies.