dimanche 29 août 2021

How To Prevent WordPress from automatically adding p tags on ONLY one page

I have one page on my WordPress website that has some custom code on it (I cannot use Gutenberg blocks, only the classic Text/Visual editor). This code does not work because WordPress keeps adding p tags everywhere.

I tried adding this code to my functions.php, but it does not work. Can anyone help me to understand why this code doesn't work and how to stop WordPress from auto-generating p tags on just this 1 page?

if($post->ID == 352331) {
    remove_filter( 'the_content', 'wpautop' );
}

Aucun commentaire:

Enregistrer un commentaire