• Resolved mcpace

    (@mcpace)


    I have a multisite install with 5 sub blogs. I want wpautop off on all blogs except one. I have created a child theme for this one and tried to add the filter back within the functions.php using add_filter, but this hasn’t seemed to work.

    Is it possible to have it turned off for all but one? How would I do that?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I’d to a check with get_current_site()

    if ( get_current_site(id) != <site you don’t want auto-P> ) { disable auto-p }

    Something like that

    Thread Starter mcpace

    (@mcpace)

    Thanks Ipstenu. So you’re saying it has to be on by default and then disable it on all the others. Is that correct?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    If you put the code in mu-plugins, then it would simply check if NOT the On-Site, then turn off. Acts like a functions.php for all sites in the network 🙂

    Thread Starter mcpace

    (@mcpace)

    “If you put the code in mu-plugins, then it would simply check if NOT the On-Site, then turn off. Acts like a functions.php for all sites in the network :)”

    Sorry, I’m not that technical, does that mean creating a plugin with just that one line of code in it? I understand what you’re saying to do, but I don’t know exactly how to implement it. I’ve activated site wide plugins, but I’ve never made a plugin. Would this be creating a plugin to activate, or create a functions.php file that goes in there.

    Thanks for the reference Andrea, I’ve already have wpautop turned off via my functions.php on my root theme, affecting all blogs, but then a team who doesn’t know html needed to have it on for just their site. So I need the easiest way to turn it on for just one subsite, b/c I don’t want to jack up everyone else’s blogs who know html and like it off.

    Ipstenu means make a folder called /wp-content/mu-plugins/

    take your code above, put it in a file all by itself, wrap php tags around it. Call the file whatever.php. Put it in mu-plugins. PRESTO ! it will work.

    See: http://codex.wordpress.org/Must_Use_Plugins

    you do not have to make a full plugin. it will automatically run.

    Thread Starter mcpace

    (@mcpace)

    Thanks, I’ll try it out.

    Thread Starter mcpace

    (@mcpace)

    Thanks, worked great!
    Here’s what I used for any others looking for it

    <?php
    if (get_current_site(id) != 8 ) { remove_filter('the_content', 'wpautop'); }
    ?>

    The code is working, but for some reason the post page I’m looking at thinks it’s on blog 1 but it’s on 8… so now I need to debug why it thinks that.

    Thread Starter mcpace

    (@mcpace)

    Hmm I might have a larger problem, my admin bar also always links to blog 1. Any ideas or is that a new thread?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘wpautop off for root but on for one sub blog’ is closed to new replies.