Articles of permalinks

Rewrite rule intended for CPTs gives 404 for pages

So I managed to get my rewrites to work finally. But since I disabled the slug that usually gets prepended for CPT’s, I’ve got general rewrites, that ends up giving me a 404 when trying to browser pages. What can I do to remedy this? If I change from top to bottom I get the […]

Passing URL parameters to WordPress pages and pretty url

I create shortcode like this function test_func( $atts ) { return $_GET[‘myvar’]; } add_shortcode( ‘test’, ‘test_func’ ); and one page with this name myparameters so this is the final url http://website.com/myparameters if I try this works perfect http://website.com/myparameters/?myvar=theparameter But i like have pretty url or friendly url like this http://website.com/myparameters/theparameter/ But show page not found. […]

Permalink shows garbage character

Prmalink is visible like this, any solution https://www.crackpcs.com/%e0%a4%ae%e0%a4%…%a5%87-%e0%a4%a4/

How can I get this custom post type permalink structure? %custom_post_type%-%taxonomy%-%term-postname%

Please help – I’ve tried almost everything and I’m absolutely lost! I’m desperate to get the following permalink structure set up: ladsholidayguide.com/custom_post/taxonomy/term/postname For example: ladsholidayguide.com/reviews/venue/clubs/liquid-nightclub I’ve tried using the Custom Post Type Permalinks plugin, yet this option doesn’t work either Check this and the custom taxonomy’s permalinks will be: www.ladsholidayguide.com/post_type/taxonomy/term/postname/ For some reason This works […]

WordPress add_rewrite_tag working for Posts, but not working for Pages

I am having an issue using add_rewrite_tag. I’ve created some custom code to allow me to append a primary tag (which is a custom field I’ve setup that allows me to set a primary tag from the list of tags) to the front of a post’s URL – e.g. www.example.com/post-name/ becomes www.example.com/primary-tag/post-name/ This works as […]

How to eliminate permalink prefix in WordPress Multisite

I have installed the multisite plugin for WordPress; I have one website in English, and the other in French. However, when I go to Settings -> Permalinks, my English website shows this: I don’t understand why there’s “/blog” in the permalink. Whereas in the French website, the Permalink is like this: Therefore when I go […]

How do I modify taxonomy term slugs dynamically?

I need to be able to modify custom taxonomy term slugs on the fly or at least display them correctly in the URL. I have looked at it from every angle I can think of, but just can’t quite figure it out. I have tried rewrites which got me close, but not close enough. Current: […]

wp not making CPT permalink / slugs unique

I’ve registered a custom post type on my site but loads of different users are able to create posts with the same slug / permalink, here is how I am registering my post type // Bucket Custom Post Type function bucket_init() { // set up bucket labels $labels = array( ‘name’ => ‘Buckets’, ‘singular_name’ => […]

get_permalink returning site home url instead of the url of slug being passed

I am fetching some testimonials data from db and based on the slugs, I am getting the links to use further. Here is my code function createPageForTestimonials($slug, $title, $content, $companyName){ $new_page = array( ‘slug’ => $slug, ‘title’ => $title, ‘content’ => $content ); //check if page exists if (the_slug_exists($slug)) { $url = get_permalink( get_page_by_path( $slug […]

Redirecting all posts after changing URL structure with htaccess

I am looking for the .htaccess regular expression that would redirect the old structure to the new one, the reason i don’t want to use plugins is they often have unexpected results when WordPress updates or the author abandon them, I need something that would 301 redirect for a long time reliably. Old permalink: https://domain.com/%category%/%postname%/ […]