Archived topic
Question on Hook Up Addon
5 replies · Started by Anonymous on April 15, 2015
I have an advertisment script, used hook up and want it to appear only on posts and not on pages. how will I do that?
You can put it inside an if conditional.
For example:
<?php if ( is_single() ) : ?>
Anything I put in here will only show up on posts.
<?php endif; ?>
Then be sure to check the "Execute PHP" checkbox.
Let me know if you need more info :)
Hi Tom,
the code worked well. thanks! :)
also, I do have additional questions
i also want to show the ads in my home page which is supposed to be shown in the excerpts of my 10 latest post. but how can I make the ads to show only in the top 2 latest post? my ads is adsense and if there are more than 3 ads, the remaining excerpts will show only a huge blank space and it does not look appealing if it stays like that. hope you can help me on this one as well
thanks in advance
That's a tough one - the code for that would be very complicated.
I'm not 100% sure this plugin has that option, but it's worth a look: https://wordpress.org/plugins/ad-inserter/
Hi Tom,
I tried to used the plugin and yes it can do what I want. :)
Thanks!
Perfect :)