Site logo

Archived topic

How to insert Taboola ads in-between content and comment?

7 replies · Started by Jericho on July 28, 2018

Viewing posts 1–8 of 8

Hi GP Team,

Is there a way to insert Taboola/MGID ads in-between content and comment? Currently, I'm using the After Content Hooks which makes the ads appears just before the category and tags.

I would like to insert the ads in-between content and comment section.

See this screenshot: https://prnt.sc/kc3qm3

Thanks!

Hi David,

My apology. Not sure if I do it correctly. I'm not really techy. :)

add_action( 'generate_before_comments_container','example_function_name' );  
function example_function_name() { ?> 
    MGID CODE HERE
<?php }

What should I put on example_function_name and where should I paste the code in GP Hooks -> After Content?

Thanks!

Hi there,

you would need to add the code to your child theme function file, if you're not using one then the Code Snippets plugin will make that possible. Link to that plugin is in here:

https://docs.generatepress.com/article/adding-php/

The function name is whatever you want it to be - make it something meaningful eg.:

add_action( 'generate_before_comments_container','jericho_before_comments_ads' );  
function jericho_before_comments_ads() { ?> 
    MGID CODE HERE
<?php }

Got it! Thanks, David!

When is the expected release date of GP 1.7?

Thats great!
1.7 is currently in Release Candidate so it should be very soon :) Maybe within a week.

Awesome! We'll with for that.

Thanks again!

Glad to be of help

This archived topic is closed to new replies.