Adding custom HTML code below pagination

Posted in: Newspaper
Post count: 13

Hi,

I’m quite new to WP and not at all proficient with PHP. I’m trying to add an ad tag right below pagination – on the search page only. I’ve edited the search.php page, but pretty much everything I add above…

</div> <!-- /.td-pb-row -->

…doesn’t get rendered.

How should I go about this?

Post count: 22421

Hi,
the best way to insert ads through the php files is the do_shortcode function: https://developer.wordpress.org/reference/functions/do_shortcode/
This nifty function will render all visual composer shortcodes including an ad box. So the best way to do it is create a dummy ad box on a page and set it up the way you like (you must make use of the ad spots in the theme panel) and then simply enter classic mode and text m,ode to get the shortcode for the element.
Then you can use the function like so:

Mind the php tags as some places already have them open so you do not need them there.
FOr your specific case with the search results, you can add the code like so: http://screencast.com/t/jSjEOEbrtu
Hope this helps.
Thank you!

Post count: 13

Many thanks for the reply 🙂 Will look into this.

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.