P tags
-
Hi all,
I use a combination of plugins.
– Advanced Custom Fields (ACF)
– XYZ PHP snippets
– WPbakery (pagebuilder)my issue is those Ptag cropping up everywhere, i’m losing my mind over it!!!
so…
step 1- i set up a ACF content/fields
step 2- create my php snippet, like below as you can see NO P TAGS
<div class=the-stakes-hero-outer><div style="color:<?php the_field('the_problemstakes_text_colour', 'option'); ?>" class="the-stakes-hero"><div class="os-titles the-stakes-title"><?php the_field('the_problemstakes_statementtitle', 'option'); ?></div><?php the_field('the_problemstakes_text', 'option'); ?></div><div class=the-stakes-image><?php the_field('the_stakes_image', 'option'); ?></div></div>
step 3- insert my php snippet shortcode into my page via text block from Wpbakery, like below
[xyz-ics snippet="The-Stakes-layout2"]
now this is where those P TAGS start to appear!!!
Once the shortcode is render on the page P TAGS get added WHY OH WHY OH WHY, why does this happen? how do i stop it?
this issue had been driving mad for 5 years!!! this is my second post about it
I have tried adding in, in a ton of different ways this code, IT DOES NOT WORK
// Prevent WP from adding <p> tags on pages function disable_wp_auto_p( $content ) { if ( is_singular( 'page' ) ) { remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' ); } return $content; } add_filter( 'the_content', 'disable_wp_auto_p', 0 );
- The topic ‘P tags’ is closed to new replies.