A
A
altkov2021-08-14 21:36:38
WordPress
altkov, 2021-08-14 21:36:38

How to create custom permalink tag in Wordpress?

It is necessary that the custom taxonomy be included in the url of posts (regular, non-custom post type) as a category. I did it this way: I registered it in the settings
http://siringallery.ru/%wall%/%postname%/, and in the code the function on the event pre_post_linkreplaces it %wall%with the desired taxonomy element. It would seem that success, only now my pages give a 404 error, because they are looking for a taxonomy element with the page name, and not a page. But the placeholder %category%doesn't do that, so how do you get your placeholder right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Alyoshin, 2021-08-15
@ArchitectOfRuin

Did you drop permalinks?
Switch to any other scheme, save, then back to your chosen scheme and Save again.
Other solutions to the problem:
look towards https://developer.wordpress.org/reference/function... (there are examples of regular expressions at the bottom of the page).
try plugin https://wordpress.org/plugins/permalink-editor/ .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question