• I am trying to create a custom post type, a custom taxonomy for the post type and then a custom permalink that will be added when a post is made. Now I have successfully made the first two, however, I am having a drawback with the custom permalink and I would like someone from the gurus of WordPress to assist me if possible and tell me where I am wrong.

    -> https://pastebin.com/JVKNafuA

    Now in general what I want to make is done, however when I visit the page, the page says too many redirect are made.

    -> https://prnt.sc/gqdNEiMBxlYk

    -> https://prnt.sc/Lgn-I4j1VDB_

    What may be the issue here?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The default rewrite rules are likely inadequate for the permalinks you have generated. You may need to add a distinct rewrite rule that specifically matches your permalinks and defines the correct query vars necessary for WP to correctly get the requested post.

    Your permalink will work best if there is some constant element in your URLs that the regexp can reliably match to. For example, if your URLs all contain “майстори”, you can use that in the regexp. The regexp can also capture other URL elements which can be assigned to query vars. Refer to the first example in the User Contributed Notes in the above link. Here, “myparamname” is the constant element and ([a-z0-9-]+) captures the subsequent URL element that is then assigned to a query var with ?myparamname=$matches[1].

    After you add rewrite rule code to your theme or plugin, visit the permalinks settings screen. This causes all the rewrite rules to be flushed and regenerated.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom post type, taxonomy and permalinks’ is closed to new replies.