Adding Disclosure to loop-single.php

Posted in: Newspaper
Post count: 6

Hello,

I’m not very familiar with php, but I want to add a disclosure to the loop-single.php code. I am using the Default Site Post Template, and this is the file that seems to map to that one.

What I want to do is add the disclosure right under the ‘By Author’ portion.

The code I am looking to add is as follows:
<div class=”custom-post-header-disclaimer”><div class=”custom-header-disclosure”>Disclosure</div>: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we have recommended. While clicking these links won’t cost you any extra money, they will help us keep this site up and running. Thank you for your support!)</div>

I will have additional CSS that will modify the styles as necessary. My goal is to have this disclaimer across all blogs on my whole site, without having to manually add it each time I use affiliate links.

Any assistance in modifying the above code to a more php friendly format, or another method of adding i t would be greatly appreciated. I currently do not have my staging environment setup, or I would just go see if I can paste the code in verbatim there.

Below is a screenshot of what I’m looking at doing.
Example
Disclosure<script async src=”//embedr.flickr.com/assets/client-code.js” charset=”utf-8″></script>

Thanks,
Buddy Baum
https://www.TrailingAway.com

  • This topic was modified 8 years by mystafet.
Post count: 6

Just as a follow-up, I added the code directly to the loop-single.php where neeeded, but still want to confirm if there is a better way to go about this other than direct html into the php file.

Post count: 22421

Hello,

The implementation is correct. There is no other way to ad code to the post templates except for the post template files. Just make sure the code is correct and you do not get any errors, and use css classes so you can target the content with css for styling.

Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.