Skip to:
Content
Pages
Categories
Search
Top
Bottom

Topic URLs not as expected, gives 404 :(


  • B
    Participant

    @piksel

    Hi all,

    Having a slight URL issue. Forums settings / slugs are default, permalink settings are using

    /%postname%/

    Forums URL is:
    http://www.website.com/forums/

    Forums topic URL one level down is:
    http://www.website.com/forums/forum/website-community/announcements/
    … where ‘website-community’ is the category, and ‘announcements’ is the first forum under that.

    Here’s where it breaks. If I hover over a topic, the URL displays as:
    http://www.website.com/forums/topic/website-community/announcements/first-topic/
    … and if I click, I get a 404.

    If I edit the URL manually, it will work as expected, I just have to take out the category and forum name from the url, such as:
    http://www.website.com/forums/topic/first-topic/

    Why are the category and forum titles appearing in the URL, and what’s the best way to fix?

    Thanks in advance!

Viewing 1 replies (of 1 total)

  • B
    Participant

    @piksel

    After a little digging, discovered my Custom Post Type Permalinks plugin wasn’t playing nicely with bbPress.

    Problem and solution (albeit temporary) documented here: https://wordpress.org/support/topic/bbpress-topic-links-in-forums-break

    Ultimately, edited the CPTP plugin file directly (ugh) line 290-something

    $parentsDirs = "";
    if( !$leavename ){
    	$postId = $post->ID;
    	if ( !in_array($post_type, array('topic', 'forum', 'reply') ) ) {
    		while ($parent = get_post($postId)->post_parent) {
    			$parentsDirs = get_post($parent)->post_name."/".$parentsDirs;
    			$postId = $parent;
    		}
    	}
    }
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar