- Posts: 2
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] Inserting 3rd party ad script after Author info
[SOLVED] Inserting 3rd party ad script after Author info
- MJ MCBRIDE
-
Topic Author
- Offline
- New Member
Less
More
11 years 1 month ago - 11 years 1 month ago #127476
by MJ MCBRIDE
[SOLVED] Inserting 3rd party ad script after Author info was created by MJ MCBRIDE
I am looking to add in a line of javascript between the author bio & latest posts at the end of a k2 article. See attachment for placement
I have placed it in the correct spot I believe /components/com_k2/templates/default/item.php
on line 425 between code here:
<?php endif; ?>
<script src="ib.3lift.com/ttj?inv_code=turfburner_article_sub">
<?php if($this->item->params->get('itemAuthorLatest') && empty($this->item->created_by_alias) && isset($this->authorLatestItems)): ?>
But the script doesn't show up when I view source. I tried adding basic text even and it won't update. Default is the only k2 template I have in there so it can't be the wrong template directory I don't believe.
ANyone have any help they could provide? Is there a cache i need to empty? I emptied the basic joomla k2 cache, and still no luck.
I have placed it in the correct spot I believe /components/com_k2/templates/default/item.php
on line 425 between code here:
<?php endif; ?>
<script src="ib.3lift.com/ttj?inv_code=turfburner_article_sub">
<?php if($this->item->params->get('itemAuthorLatest') && empty($this->item->created_by_alias) && isset($this->authorLatestItems)): ?>
But the script doesn't show up when I view source. I tried adding basic text even and it won't update. Default is the only k2 template I have in there so it can't be the wrong template directory I don't believe.
ANyone have any help they could provide? Is there a cache i need to empty? I emptied the basic joomla k2 cache, and still no luck.
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 month ago #127477
by Lefteris
Replied by Lefteris on topic Re: Inserting 3rd party ad script after Author info
Hi. First of all don't edit core K2 files as you will lose all your changes in future updates. You can always create overrides and add your custom code there. Details on this can be found at getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates . Now if your change is not applied, probably it's because your site is already using overrides and you need to add the code to them.
Please Log in or Create an account to join the conversation.
- MJ MCBRIDE
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 2
11 years 1 month ago #127478
by MJ MCBRIDE
Replied by MJ MCBRIDE on topic Re: Inserting 3rd party ad script after Author info
Thanks there was a template in place which is why it wasn't working. I assumed the custom template would of been in the component k2 templates folder not the general joomla template.
This is resolved
This is resolved
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 month ago #127479
by Lefteris
Replied by Lefteris on topic Re: Inserting 3rd party ad script after Author info
You are welcome.
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- [SOLVED] Inserting 3rd party ad script after Author info