-
AuthorPosts
-
October 31, 2023 at 12:37 am #1424189
This is more of a question of execution, so I’m mostly asking for ideas on how to achieve this.
I’m building a new site for an existing blog.
On blog post pages, I want to be able to automatically inject content into the middle of the post, effectively breaking up the post a little.
This content would be pulled from a repository – perhaps custom post type? So I could create various types of content (text ad, graphical ad, a sign up form etc).
So for example, lets say a blog post is 10 paragraphs long.
I wish to inject a little “ad” in the middle of the post, which promotes another page or post in the site. Or perhaps it will be a signup form, for readers to subscribe to the newsletter. So kinda like injecting an advertising banner, except the ad is an internal one for the site itself.
This would of course apply to ALL blog posts on the site, although it would be even better if you could select particular category posts it would apply to (so it would “inject” into posts under Category B, but not into posts under Category C, for example).
Then it would probably need to have some sort of “limit” – it wouldn’t inject into posts if they have fewer than X number of words (because it would look silly).
I’m assuming the best method would be to:
1. Create custom blog post template page under the Child theme
2. Code the file with a custom script/shortcode that “publishes” the content from custom fields or custom content into the blog post after X amount of content?Am I overthinking this? Is there a plugin that already does this?
Any ideas/comments welcome.
October 31, 2023 at 4:03 am #1424207Hey adapt,
Thank you for the inquiry.
You might be able to use the following filter to divide the content in half and insert the custom content in between.
// https://developer.wordpress.org/reference/hooks/the_content/
Best regards,
IsmaelNovember 2, 2023 at 8:40 pm #1424439Hei
I hope you can help me.
We have a problem with Enfold and WooCommerce on the website labhsuet.no.1. The problem is WooCommerce’s problem using Enfold.
The site works extremely slow when we work backend. It have been a problem in a few weeks now.
We have switched plugins on and off and received feedback that there is something wrong with Enfold.
This topic comes up and our webhotell tells us this problem:In this case, WordPress found an error with your theme, Enfold. WordPress has a built-in feature that detects when an extension or theme causes a fatal error with your site and notifies you with this email automatically. In this case, WordPress found an error in one of your extensions, WooCommerce. First visit your website https://labhuset.no/ If you seek help with this problem, you may be asked for any of the following information: WordPress version 6.3.2 Active theme: Enfold (version 5.6.6) Current Extension: WooCommerce (version 8.2.1) PHP version 8.1.13
2. It´s also a problem that the media don´t images in the media do not appear when they are to be loaded on the pages.
May I be allowed to send you the login codes so that you can look into the problem and find out whats wrong?
Best regards Silje from SHR Design.
November 2, 2023 at 9:56 pm #1424443@Ismael – thanks for the reply – that’s not something I had considered. Much appreciated!
@SHR Design – you might want to create your own thread for your issue, as it’s completely unrelated to this topic.
November 4, 2023 at 12:52 pm #1424631Hi adapt,
Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardNovember 4, 2023 at 12:53 pm #1424632Hi SHR Design,
Please open a new thread and include WordPress admin login details in private, so that we can have a closer look at your site.
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.