Site logo

Archived topic

I get unwantet when I use your theme.

7 replies · Started by ER on June 22, 2022

Viewing posts 1–8 of 8

I found this:

If you instead wish to prevent WordPress from adding <p> tags on both pages, posts and all other post types, you can simply remove the if ( is_singular( 'page' ) ) statement, like this:

// Prevent WP from adding <p> tags on all post types
function disable_wp_auto_p( $content ) {
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
return $content;
}
add_filter( 'the_content', 'disable_wp_auto_p', 0 );

Where should I added when using your theme. Is there some other code I can add?

Hi ER,

That code is PHP.

If you’re using a Child theme, you can add it via the functions.php but if you’re using the Parent GP theme, you’ll need a plugin like Code snippets.

Here’s are reference to adding PHP code:https://docs.generatepress.com/article/adding-php/#code-snippets

Kindly make sure the the quotation marks in your code are straight when adding them to your site as copying and pasting sometimes makes the quotation marks slanted. This will cause an issue or make the code not work if not corrected.

Hope this clarifies!

I downloaded the plugin. Do you know how to use it?

Can I found it somewhere in dashboard?

Hi. I don't see any "snippets" on my dashboard.

Have you activated the plugin Code Snippets after installing it?

This archived topic is closed to new replies.