Post & Category Archives URL structure

The issue with your desired structure (and that categories without base are common request but commonly unreliable) is ambiguity. Each rewrite rule is like a tiny program, explaining WP how to turn URL into query variables. It is very important that WP can reliably distinguish which of the rules should handle particular URL. In plain … Read more

Change url to posts if they have custom tax only

It works for me. add_filter(‘post_link’, ‘locale_permalink’, 10, 3); add_filter(‘post_type_link’, ‘locale_permalink’, 10, 3); function locale_permalink($permalink, $post_id, $leavename) { if (strpos($permalink, ‘%category_slider%’) === FALSE) return $permalink; $post = get_post($post_id); if (!$post) return $permalink; if ($post->post_type != ‘post’) { return $permalink; } else { $terms = wp_get_object_terms($post->ID, ‘category_slider’); if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0])) $taxonomy_slug = $terms[0]->slug; else … Read more

How to change URL of my pages?

I combined this nice solution for adding an additional option to the permalinks page and this snippet for adding a custom base name to page permalinks. Usage Save the snippet below as wpse238124-page-base.php, place it in your plugins directory, and activate Page Base on your plugins page. Then, visit your permalinks page, enter your desired … Read more

From whence %E2%80%8E at the end of post link

Mystic! I don’t know why, but if I use code like this: <?php $original_permalink = get_the_permalink($original_post_id); ?> <a href=”https://wordpress.stackexchange.com/questions/238467/<?=$original_permalink?>‎”><?=RU_LINK?></a> I get %E2%80%8E at the end of URL. But if i use different names of variables my code works fine: <?php $ru_link = get_the_permalink($original_post_id); ?> <a href=”https://wordpress.stackexchange.com/questions/238467/<?=$ru_link?>”><?=RU_LINK?></a>