• Resolved sk_tamilan

    (@sk_tamilan)


    I am trying to enable the wpautop just to single posts and to a specific page.

    The following function works for just single posts

    function custom_wpautop() {
    
      if (!is_single()){
        remove_filter('the_content', 'wpautop');
        }
    }
    
    add_action('wp_head', 'custom_wpautop');

    but when i add the following to include the page its not working(I get a Server Error 500 Page )

    function custom_wpautop() {
    
      if ( !is_single() || !is_page(7) ){
        remove_filter('the_content', 'wpautop');
        }
    }
Viewing 1 replies (of 1 total)
  • Thread Starter sk_tamilan

    (@sk_tamilan)

    nevermind i managed to fix: –

    function custom_wpautop() {
        if (!is_single()){
        remove_filter('the_content', 'wpautop');
        }
    }
    
     function custom_wpautop_blog() {
        if (is_page(7)){
        add_filter( 'the_content', 'wpautop' , 99);
        }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘custom_wpautop function’ is closed to new replies.