• Resolved mathiasvagni

    (@mathiasvagni)


    The last two days I have tried everything I can think of and can not get permalink rewrites to work on my custom post type and taxonomy.

    You can see my register post type and custom taxonomy code here: https://pastebin.com/waKwFMHt (I temporarily set the rewrite to false after almost giving up).

    At the moment the archive of a custom taxonomy is:
    https://www.sampleurl.com/?project-type=projects

    And a single post is in that taxonomy is:
    https://www.sampleurl.com/?portfolio=post-name

    From my understanding, just by setting rewrite true on both my taxonomy and post type, it should rewrite the two above as:
    https://www.sampleurl.com/project-type/projects
    https://www.sampleurl.com/portfolio/post-name

    I couldn’t get that to work.
    EDIT: It did change the urls to above but I get a 404 ??

    What I would ideally like to have is this:
    https://www.sampleurl.com/portfolio/projects
    https://www.sampleurl.com/portfolio/branding
    https://www.sampleurl.com/portfolio/categoryname
    .ect for any category of my custom post type

    and then this for my single post in my custom post type.
    https://www.sampleurl.com/portfolio/categoryname/postname

    I’m really stuck and would greatly appreciate any help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Were you able to get this working? I’m having the same trouble, but have yet to resolve it. Could you explain how you got it to work?

    Thread Starter mathiasvagni

    (@mathiasvagni)

    I did. I was doing it right all along. I simplify found out that certain names can’t be used for the rewrites. (I.e there are some temperamental conflicts with certain names such as the same name as the custom taxonomy or post-type ect.)

    Also, i found that a more reliable way to flush the rewrites and see if they work is simply click on the settings -> permalink option. I was trying to flush the rewrites myself and that was evidently not working well.

    Give it a go. Otherwise, you could post some code?

    I had same problem, but I did create .htaccess file, as it was not there (check if not hidden).
    I used this code, suggested by WP:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    and done ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Post Type & Taxonomy Permanlink Rewrite Not Working’ is closed to new replies.