• Resolved Supersilly

    (@supersilly)


    I want to add a small text with links to give credit for the photo I have used in my feature image as per the CC guidelines. How can i accomplish this? I would prefer it to be just below the feature image of the post (before the title) aligned right.

    All help appreciated.
    Thanks for the great support Silkalns.

    My website supersillytraveller.com

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author Silkalns

    (@silkalns)

    Here is one thing that you can do based on WordPress Custom fields. You can read more about Custom Fields on official WordPress documentation that you can find here.

    Let me know if this helps.

    Thread Starter Supersilly

    (@supersilly)

    Thanks for pointing the direction Silkalns. I figured how to do it properly.

    I used custom field and made a new div to place it where i wanted. See the end result here.

    https://supersillytraveller.com/apartment-renting-in-japan

    Steps to achieve it.

    1) Add this code to the end of style.css of your child theme.

    .post-photo-credit {
      padding: 5px 50px;
      background-color: #FFF;
      border: 1px solid #dadada;
      border-top: none;
      border-bottom: none;
      text-align: right;
      font-style: italic;
      font-size: 75%;
    }

    2) Add this code to the content-single.php of your child theme. Add it above <div class="post-inner-content">

    Code to add

    <div class="post-photo-credit">
    <?php echo get_post_meta($post->ID, 'photocredit', true); ?>
    </div>

    Then in the post activate custom fields and make new field with the id used in the previous code. In this case “photocredit” and then enter the what you want to display.

    I hope this helps others

    Cheers
    Silly

    Theme Author Silkalns

    (@silkalns)

    Looks awesome!

    Thank you for posting your solution here! Will use it as reference to others.

    Thank you!

    That was helpful thank you!

    For those who want to display a similar notice on the main page as well, just add the exact same code in content.php, at the exact same place (Above <div class=”post-inner-content”>).

    I’m a total php noob but this seems to be working!

    Anyway, thanks for this nice theme.

    Regards,
    Ject

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Photo credit with links below the feature image’ is closed to new replies.