Adding a sub-site at "/blog"

I'd like to have a separate blog in my network installed at the /blog address but as I'm using sub-directory install it won't allow it, does anyone know of a way around this?

I've already modified the root site and removed all 'blog' permalink structures, categories, pages and the 'blog' value which is added to the 'Banned Names' box but none of this allows a new site with the name /blog to be created - I just get this:

"The following words are reserved for use by WordPress functions and cannot be used as blog names: page, comments, blog, files, feed"

Which is quite annoying :slight_frown: any ideas?

  • Barry
    • DEV MAN’s Mascot

    It's hardcoded in the WP source code by the looks of things. You can override with a filter, but i'm not 100% sure how well it'll work.

    If you create a php file (called something like gimmeblog.php) and put it in your mu-plugins directory. It should contain something like:

    <?php
    
    function my_gimmeblog_override( $allowed ) {
    $found = array_search('blog', $allowed);
    
    if($found !== false) unset($allowed[$found]);
    
    return $allowed;
    }
    
    add_filter( 'subdirectory_reserved_names', 'my_gimmeblog_override', 1 );
    ?>

    It's a bit of a hack, and could be written better but it should work.
    Note: it was written in this reply box, so i haven't checked it myself.

  • Timothy Bowers
    • Chief Pigeon

    Not sure if anyone else has any idea but I think if its in sub-site (sub domain or sub-directory?) then all blogs will be done as such.

    Does it need to be a separate site, just wondering because if not you could just set up a blog page for that slug url and then have all blogs appear on there.

    I noticed this plugin:

    http://wordpress.org/extend/plugins/page-theme/

    Specify the theme (not template, that is already taken care of by WordPress) you wish to use with each given page or blog post.

    Not sure how well it works, I've never tested it but if it works as expected then it would allow you have one design for main part of your main site and then use a different theme for the blog pages thus giving it the appearance of being a separate blog.

    If it doesn't work and/or you don't find a satisfactory way to achieve what you want then you could consider a custom job: https://premium.wpmudev.org/wpmu-jobs/new-project/

    Hopefully this might help. :slight_smile:

    <Think I might have misunderstood your request now by reading your post again and Barrys' response, sorry>

  • Michael Kimb
    • Design Lord, Child of Thor

    Thanks guys, I did some testing and ended up giving up as it was very hacky.

    This was a decent resource: http://wordpress.stackexchange.com/questions/536/how-do-i-get-blog-on-my-wordpres-multisite

    But ultimately this is too much of a core hack for me to bother with. I could have got it working but the workaround is just as good, I just need to spend more time on my user permissions and core theme.

    It seems pretty easy in sub-domain mode FYI :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.