This function will remove the auto adding of “<p>” tag on specific page template for wordpress.
function autop(){ global $wp_query; $page_id = $wp_query->post->ID; $template = get_page_template_slug($page_id); if($template == 'templates/full-width-no-container.php'){ // template name remove_filter ('the_content', 'wpautop'); remove_filter ('the_excerpt', 'wpautop'); } } add_action('wp','autop');
1 Comment
Nice thanks for this keep sharing! 🙂