Home › Forums › Calendar Products › Events Calendar PRO › Positioning ads between posts in category view?
- This topic has 6 replies, 4 voices, and was last updated 9 years, 9 months ago by
tribedude.
-
AuthorPosts
-
June 27, 2016 at 3:10 pm #1132630
tribedude
ParticipantI would like to put an ad slot in between posts in the category event lists (see my screen cap with the red arrow pointing to the spot). How can I do this?
Also, how can I put an ad slot at the event of each event in single post view?
I have been trying to do this with the hooks provided in my wordpress theme and it is not working. Is there another way to do it? I hape to inject some DFP served ads into those positions.
Thank you.
June 27, 2016 at 4:41 pm #1132682Josh
ParticipantHey Alex,
Thanks for reaching out to us!
There are a couple of ways that you could go about accomplishing this.
The first would be to utilize the hooks in the calendar views to output your ad code. For this you could use the “tribe_events_after_the_content” hook for the list view and the “tribe_events_single_event_after_the_meta” for the single view.
Secondly, you could follow our Themer’s Guide to copy the single-event.php file and list > single-event.php files into your theme and include the ad code wherever you would like into those templates.
Let me know if this helps.
Thanks!
June 27, 2016 at 5:07 pm #1132696tribedude
ParticipantThe first would be to utilize the hooks in the calendar views to output your ad code. For this you could use the “tribe_events_after_the_content” hook for the list view and the “tribe_events_single_event_after_the_meta” for the single view.
This is what I would like to do, but where can I find these hooks? I have something called “hook content” in my theme, which allows me to position ad slots in various places but the hooks you mention aren’t available as selections for me…
June 28, 2016 at 9:10 am #1132920tribedude
ParticipantI am not an engineer and my php knowledge is limited.
Is there a way to access the events calendar hooks from within my wordpress dashboard to put ads in that way?
June 29, 2016 at 7:22 am #1133394Josh
ParticipantHey Alex,
Thanks for following up here.
There would be a way to access the hooks within your WordPress dashboard. These hooks are intended to be used in a code context to add additional code in particular locations.
To utilize this particular hook, you would add the following code (updated with the custom code you’d like to add) to your theme’s functions.php file
add_action( 'tribe_events_single_event_after_the_meta', 'tribe_events_after_content_ad' ); function tribe_events_after_content_ad() { ?> //add your ad code here <?php }Let me know if this helps.
Thanks!
July 14, 2016 at 9:35 am #1139719Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Positioning ads between posts in category view?’ is closed to new replies.
