Support » Fixing WordPress » How can I remove the "blog" part of my URLs?

  • Resolved wildbug

    (@wildbug)


    For some reason, my website is set up using the directory “blog” after the domain name in the URL. (e.g. http://mydomain.org/blog/category/categoryslug/) I’d like to remove that “blog” to shorten my URLS. Is this easy to do? Can someone give me a link to instructions or paste them here?

    Also, I am trying to create a separate archive template for certain categories. I’ve done this on another blog so I know it works. But for some reason, the category #s I have are not showing up with the correct template. Here is the code I am using to direct to the correct templates:

    <?php
     if ( have_posts() ) { the_post(); rewind_posts(); }
     if ( in_category(6,14,15,16,17,18,19,20) ) {
     include(TEMPLATEPATH . '/archiveshousing.php');
     } else {
     include(TEMPLATEPATH . '/archives.php');
     }
     ?>

    But for all those categories listed, it shows the archives.php not the archiveshousing.php.

    Any tips? Here’s my site if you need to view it, but most of the sections I am working on are set as private at the moment.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Can someone give me a link to instructions or paste them here?

    Giving_WordPress_Its_Own_Directory

    Moderator keesiemeijer

    (@keesiemeijer)

    For the categories use this:
    is_category(array(6,14,15,16,17,18,19,20))
    or this:
    in_category(array(6,14,15,16,17,18,19,20))

    Thread Starter wildbug

    (@wildbug)

    You both rock, thanks for the quick responses!

    Right now I have multisite enabled. Is that why it added in the “blog” in the URL? It hasn’t done that on my other sites. If I remove the multisite, will it remove the blog directory automatically?

    Moderator keesiemeijer

    (@keesiemeijer)

    The /blog/ part is intentional to avoid permalink conflicts off the main site. It is not a good idea to change this for a large website. I have a multisite with 4 sites without the /blog/ part. Go to Super Admin > Sites and hover with the cursor over the “/” site and click edit. put in your “Permalink Structure” without the blog part and click “Update Options” . There is one catch, if you update your permalinks in Settings > Permalinks it will put the blog back in your permalinks. I think that is how I’ve done it, it was a long time ago, but it’s possible

    Alwyn Botha

    (@123milliseconds)

    Please mark thread as resolved so that

    – others with similar problem can see it as resolved and will read this thread for help if they have similar problem

    – people providing help see it as resolved and will not waste time reading this post.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How can I remove the "blog" part of my URLs?’ is closed to new replies.