Tagged: Blog, MailChimp, newsletter
I added a mailchimp form after each post by following the instructions for “Add mailchimp to all page/post” here. But, the form also shows up on blog and archive pages after every post, how do I remove those? I couldn’t find any help using Google.
Hey drewtarvin,
Thank you for using Enfold.
That feature or option is not available in the theme by default. Are you using a third party plugin for that? Maybe we can use css to hide the form when the current page is a blog or an archive page.
Best regards,
Ismael
I just followed the instructions at the link I shared (instructions from Enfold) where I added code to my functions.php file. I don’t know enough about wordpress coding to have it only display when it’s on a single page and not all the time, and was hoping someone may know.
Hi,
Thank you for using Enfold.
Did you add the mailchimp signup form as a widget? You can use the following plugin to set the visibility of the widget.
// https://wordpress.org/plugins/widget-logic/
Best regards,
Ismael
I did not. I was hoping there was just a simple change I could make in the if / case statement that would work instead of adding more plugins to my site. I’ll keep searching, thanks.
Hi,
My bad. I didn’t know that you’re using the the_content filter. Please look for this line:
if( ! $post instanceof WP_Post ) return $content;
And replace it with:
if( ! $post instanceof WP_Post || is_archive() || is_home() ) return $content;
That should prevent the subscribe form from rendering in the archive and blog pages.
Best regards,
Ismael
That worked perfectly, exactly what I was looking for, thank you!
Hi,
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,
Rikard
Yes, please close!