Adding affiliate disclosure to blog post meta data

Hi there

I am trying to add an affiliate disclosure in the meta data of all my blog posts. I found the below topic

https://theme.co/apex/forum/t/adding-information-to-blog-post-meta/2634. This is exactly what I want to achieve.

I have installed a child theme and have saved the code to texteditor however is not allowing to save as a php file, it is saying I have to save it as php.rtf.

I am not sure where to go from here. I have saved the file into the child theme folder under Framework/views but will this upload to my child theme with the .rtf in the file and how to do I actually upload it?

Thanks

Laura

Hey Laura,

WordPress only reads PHP files. It sounds like you’re doing it incorrectly and looks like you’re using a Rich Text editor and not a Text editor. Please use Notepad. When you save a file, you need to choose All Files so it will allow you to use any extension.

The guide in the thread you linked to should work provided you followed it correctly and are using the Renew stack. Please note that this is best done by a developer as he/she understand how WordPress development works. Moreover, issues arising from customization and further enhancements are outside the scope of our support.

Thanks.

Thanks Christian. I can’t afford a developer at the moment. Instead of messing about with customization. Can I add this using ‘custom fields’ in the posts editor. I tried to add this in as per below but nothing is showing above the post.

This is where I want the affiliate disclosure to appear

Thanks,
Laura

Hey Laura,

It would still require template modification to integrate the custom fields and template modification is the best solution. Since that is not feasible for you, the least we could do here is use jQuery to move content from one area of your site to below your entry-header like this.

To do that, add the content in a Text widget and then add this code in Theme Options > JS

jQuery('#text-5').insertAfter('.entry-header');

Replace text-5 with the ID of your widget (this is how to get the ID of your text widget) and replace .entry-header with .single-post .entry-header if you wish to implement it in single posts only.

Hope that helps.

Hi Christian, this has worked! Thanks :slight_smile: But, I put the text widget under footer 1 as wasn’t sure where it should go. So now on the blog posts it is in the right place but it is showing in the footer of the pages. How do I remove this? Sorry if this is a silly thing to do, I am terrible at this stuff! Thanks, Laura

Don’t worry, I’ve fixed it by changing the visibility settings within the widget. Thanks! Laura

Hi Laura,

Yes that is right, you should be able to set the visibility settings of a widget from there.

Glad to hear you got it sorted.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.