You are using custom template for static page.
So you should enable display also on static pages.
However, the PHP function is called 23 times on
http://myplasticfreelife.com/plasticfreeguide/
Maybe you put call to php function at wrong place inside loop.
Of course, you can also filter insertions. For more info please check
https://ww.wp.xz.cn/plugins/ad-inserter/
Have you been able to solve the problem?
-
This reply was modified 9 years, 8 months ago by
Spacetime. Reason: wrong text
Hi. It is not solved.
The page is set up with content typed into the page editor at the top, and then a loop of custom post types that appear after the page content.
I have enabled display on selected static pages. In the page editor, I clicked the checkbox to enable ad inserter. As you can see, an ad was inserted underneath the content at the top of the page — before the loop. But the php added to the loop in the template is not inserting the ad as it should.
You noted that there were 23 calls to the php function. That is correct, as there are 23 sections on the page, and I want each section to show an ad.
Do you have any other ideas?
-
This reply was modified 9 years, 8 months ago by
bethfly.
On the page
http://myplasticfreelife.com/plasticfreeguide/
block 1 is inserted.
It is configured to automatically display After content and it is inserted there when the plugin is first called.
The content for the first call is the first three paragraphs:
<p>Do you think it's possible to live life without pla ... n to the people you love. We can all make a difference.</p>
So the plugin iserts block 1 after that content.
However, for this page the cotent hook is called 101 times!
And for other 100 calls the block is not inserted because it is enabled only on selected pages and other content hook calls give data for pages not enabled for this block.
PHP function call is called 23 times and each time the block is not inserted because it is enabled only on selected pages.
You are doing something terribly wrong!
Please check your code.
And do not use the same block for automatic and manual insertion at the same time unless you know what you are doing.
>>And do not use the same block for automatic and manual insertion at the same time unless you know what you are doing.
That was the problem. I created a new ad block without automatic insertion, chose “all static pages” and now the ads are showing up on the page 23 times, which is correct.
And yes, you seem surprised that the content hook is called 100 times. Did you notice there are 100 list items? Each one of those items is a separate post.