• Resolved Amber Fellows

    (@amber-fellows)


    I have read the “Using Permalinks” Codex, along with a couple of other articles.

    On my Admin’s Permalink Settings page I have selected the “Custom Settings” option and entered “/%post_id% /%postname%/” in the field (leaving nothing in the ‘optional’ tag or category base fields).

    After much fiddling this made my page URL’s display as I would like them to, but not my categories (the blog on the far left of the navigation tab). It seems that no matter what structure I choose the word “category” is in the URL.

    NSFW!
    https://www.laceinyourface.com/

    How can I make it go away, while keeping the (displayed) structure of my page URLs?

    ??

    Thanks.

Viewing 1 replies (of 1 total)
  • Amber Fellows,

    The best method we have found is to add the following code (between the <?php and ?> tags. I’ve included the website this code snippet originated from in case you need to reference it later.

    // REMOVE CATEGORY BASE
    // https://www.bloggingtips.com/2009/02/01/remove-the-category-base/
    //-----------------------------------------
    add_filter('user_trailingslashit', 'remcat_function');
    function remcat_function($link) {
    	return str_replace("/category/", "/", $link);
    }

    The final step is to simply ensure that the Permalinks Setting is /%category%/%postname%/

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot get "category" out of permalink’ is closed to new replies.