-
Author
-
September 28, 2016 at 20:46 #137503hchyParticipant
Hello 7th Queen,
I posted a question earlier on how to add a ad before content and a moderator responded extremely fast and I appreciate that very much. I have implented the code that was provided and it works fine:
function ads_before_content() {
echo ‘
<div style=”width:728px;height:90px;background-color:red;display:block;margin:0 auto;”>
728 AD
</div>
‘;
}
add_action (‘kleo_before_content’, ‘ads_before_content’);
—————–
I then tried to add a block of code like this to functions.php, but changed before to after. To try and get a ad block after the content? but I noticed it did not work properly and made a ad block appear to the left of the sidebar. Is there another trigger to call for ad block after content? This is my last question, thanks again for your help if you can provide.
September 29, 2016 at 07:03 #137542LauraModeratorHello, can you share admin credentials so i can check it out?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
September 29, 2016 at 07:40 #137547KieranParticipantHi @Hchy,
If you’re looking to add it above the main content only (so it does not appear above the sidebar) you would do something like
COPY CODEfunction ads_before_content() { echo ' <div style="width:728px;height:90px;background-color:red;display:block;margin:0 auto;"> 728 AD </div> '; } add_action ('kleo_before_main_content', 'ads_before_content');
as for after the main content it would be something like
COPY CODEfunction ads_after_content() { echo ' <div style="width:728px;height:90px;background-color:red;display:block;margin:0 auto;"> 728 AD </div> '; } add_action ('kleo_after_main_content', 'ads_after_content');
The code you shared above would “render something before the main content and sidebar” see here https://archived.seventhqueen.com/documentation/kleo#hooks
Hope this helps 🙂 If I got the wrong end of the stick please accept my apologies for jumping into the conversation.
October 1, 2016 at 16:05 #137800hchyParticipantThank you very much, appreciate the reply. after_main_content worked fine. Have a good week!
October 4, 2016 at 11:37 #138064LauraModeratorAwesome! Thanks you @kieran for the help
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
-
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.