Archived topic
How to insert "custom area" after X post in Blog part?
14 replies · Started by Dmitry Bychenko on March 27, 2017
Hello,
How to insert "custom area" (to put banner in my case) after every X post in Blog part?
background, width.. could be the same size as Post's box.
sorry, didnt use the search. not sure how to word it.
Hi Dmitry,
I think this plugin might do what you want: https://en-ca.wordpress.org/plugins/ad-inserter/
Give it a shot and let me know?
Hi, Leo, thanks for answer.
I dont think it's what i want.
if i have understood it correctly, this plugin inserts Ad inside the post (inside the text of the particular post).
Im looking for opportunity to insert ad between the posts themselves (without going inside of the posts).
for example, you installed new WP and in Settings -> Readings you have Front page displays settings:
[tick] Your latest posts, i.e.
Front page: none
Posts blog: none
With this settings on your front page you have list of articles, for example:
Post 1. How to install WP?
Post 2. How to set up WP?
Post 3. How to install plugin on WP?
"Custom area": Whiskas - cats best friend
Post 4. How to add new user in WP?
Post 5. How to move WPsite to another hosting?
.... and so on.
check the example:
Example
Insert custom area in the list of posts, NOT inside the post itself.
----------------------------------
Another example:
If you take WP+GP site, and go to some Post Category
for example, you have site with categories:
Install WP
Set up WP
Database
Hosting
FAQ
....
and in the list of categories you click "FAQ"
you move to this address http://mysite.com/category/faq
the very first block, where category title is written is a good example of what i want i get.
I've looked into this before. It requires you to edit the structure of how WP displays the posts.
For example: http://wordpress.stackexchange.com/questions/61136/insert-image-or-ad-script-after-3-posts-using-the-loop
There's not an easy solution I'm afraid. If you do attempt to do it, you'll want to use a child theme.
ok, thanks
No problem. Let me know if you hit any road blocks along the way :)
Tom, is there some WP plugin which can do that?
Not that I'm aware of, but there's a lot of plugins out there I'm not aware of :)
I'll keep an eye out.
thanks
Hi, Tom,
I have created child theme, syle.css and functions.php are in Child theme folder.
and i contacted ad plugin developer.
they sent me instructions on how to put ad between X amount of posts:
http://wordpress-advertising.tunasite.com/docs/using-template-tag/
Can you say a bit more how to use their code?
That won't put anything between x amount of posts, it's just a way to display their shortcode in a template file (PHP code).
I contacted plugin developer, he wanted to see single.php
I showed him single.php, thats what he replied:
"Your themes single.php is split up into different functions. You will need to get the page that gets loaded by the following function:
<?php get_template_part( 'content', 'single' ); ?>"
Can you tell me what he wants?
The loop that displays the content of the single posts is inside the content-single.php file.
So that's the file you would need to overwrite if you need to make changes.
thanks!
No problem :)