Currently my Blog Module displays: Author | Date | Category | Comment Count
I wanted to add a link to my affiliate disclosure at the end of that post meta data so that it would read: Author | Date | Category | Comment Count | This post may contain affiliate links
When not using the Divi Theme Builder, I had previously been able to accomplish this on other Divi sites by editing the single.php file in my child theme. However that was not working in this instance since I was now using their Theme Builder. So I reached out to Elegant Themes support for help and they sent me this code which works like a charm.
Add this code to your Divi –> Theme Options –> Integration into the <head> section:
<script>
jQuery(document).ready(function(){
jQuery('.comments-number').append(" | Link text goes here");
$(".comments-number").wrap('<a href="https://example.com" />');
});
</script>
Obviously replace the “Link text goes here” with whatever you want it to say and the “example.com” with your URL. Here's how it looks in action on my site:
hi there
i implemented this but it does not show as a link just a plain text, any ideas?
Hey Nordie – Unfortunately I’m not sure what help I can offer here. It’s tough to troubleshoot sight unseen. Other JS could be conflicting with this, or a browser extension, or a caching or JS minimizing on your site… the list goes on and on. Sorry I can’t be of help to you.