How To Insert Auto Ads In PHP Custom Template
-
Ads health shows 0 on this page and on the search page (https://winehopper.app/search-wineries/) shows a blank area where the ad should be. These are PHP theme pages which display data based on a REST service, but I haven’t been able to get the ads to show consistently on these two. They have been added as pages to use in the ad collection settings … help!
The page I need help with: [log in to see the link]
-
Hi slinky39,
How do you inject these ads? Do you use Shortcodes, placements, or PHP code?
Best regards,
JoachimFor those that work, I have used placements under Ads-Display Conditions. This works for most of the posts so far along with the front page / about / trivia. What I am having trouble with is he custom PHP Theme pages that search and display from a REST service. On these I have unsuccessfully tried placement on the base page and PHP shortcode insertion (this may work if you have the correct insertion method to suggest). From what I could find, do_shortcode is supposed to work for inserting the shortcode in theme pages.
Hi slinky39,
Sorry, I’m still not really clear what you’re getting at.
In the subject of this thread, you mention the insertion of Auto Ads. The code for that is available on the two pages linked in the first post. If AdSense is not serving ads there, that’s on AdSense. In that case, I would switch to placing ads manually, as you do on the About us page.
Can you please clarify if you want to integrate Auto ads or manually inserted ads on the two pages in question?
Best regards,
JoachimManual will not work directly in the PHP code. That single link doesn’t indicate the correct way to show ads using PHP and shortcode.
Hi slinky39,
You can insert manual placements via PHP. But I am curious about your answer to the first question: Can you please clarify if you want to integrate Auto ads or manually inserted ads on the two pages in question?
Best regards,
JoachimIt must be a misunderstanding on my part. I understand “auto” to mean automatic selection. Maybe it is a different meaning?
I have what I believe are auto ads being placed after the content on the pages where it works. Is do_shortcode() the correct way to place an add using PHP code?And now it works with the code
if(function_exists('the_ad')) the_ad(229);
Still not working on the trivia PHP page, but I will eventually get that one figured out. Thanks.
The topic ‘How To Insert Auto Ads In PHP Custom Template’ is closed to new replies.