New answers tagged

0

Try adding the following to a manually generated .htaccess file # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Without knowing more about the version of ...


0

In extension to pooria's answer above: If you are using the CPT UI plugin to manage your custom post types, there is a dropdown to toggle the with_front option: By default this option is set to True so you will have to change it for all post types for which you want to start the permalink with your site URL.


0

Welcome to WPSE. That can be solved pretty straight forward. Register a custom post type products Register two taxonomies (brands and functionalities) for your custom post type Feed WordPress the correct template, following the template hierarchy and WordPress standard Flush your rewrite rules (can't be skipped, but is easy) Step 1 Register your custom ...


1

At the top of your .htaccess file, before your existing WordPress directives, you could do something like the following to redirect the old permalink: RewriteRule ^\d{4}/\d\d/([\w-]+\.html)$ /$1 [R=301,L] The RewriteRule pattern matches against the URL-path less the slash prefix. \d{4}/ - matches the 4-digit year, followed by a slash. \d\d/ - matches the 2-...


0

You can check how the site_url is stored in the wp_options table - make sure there is not a space after the url.


2

The way I see it, you could do: // Via the init hook, do all these: register_post_type( 'library-books', [ 'public' => true, 'label' => 'Library Books', 'rewrite' => [ 'with_front' => false, 'slug' => 'library/books' ], 'has_archive' => 'library/books', // other args here ] ); register_post_type( '...


1

use the default linking option in wordpress, remove the domain name and start it with /, for example https://example.com/posts/post10 becomes /posts/post10


2

The problem, as I could see it, is not with the get_the_category() function. Instead, it's the way you output the category archive link: href="<?php echo $cd->slug ?>" — you should instead use get_category_link() to get the correct URL of the category archive page. Example: <a href="<?php echo esc_url( get_category_link( $cd ) );...


1

When you are in the page you want to update, you can modify the slug at the top above the editor: By default Wordpress uses the Page title, but you can change the 'slug' to whatever you want. You can also look at Settings > Permalinks for some more options.


0

For those who might not use plugins or prefer light-weighted method. This might be of help. This method redirect attachment to the exact file instead of the attachment page and it is the method that some plugins are using. To test, by putting the following code in functions.php of the theme. add_action( 'template_redirect', 'test_attachment_redirect', 10 ); ...


0

EUREKA! My taxonomy name is 'store-category'. When i used 'rewrite' = true or 'rewrite' = array('slug' => 'category') it was giving me a 404 error. When I changed it to 'rewrite' => array('slug' => 'group') the problem just went away! So, the problem turned out to be a rewrite conflict. WordPress had been looking for my store-categories within ...


0

From what I know you can use the post_updated or the save_post hooks https://developer.wordpress.org/reference/hooks/post_updated/ https://developer.wordpress.org/reference/hooks/save_post/ Hope that this help. If you need any other info please let me know. Update: Sorry for my misunderstanding. You can use the the_permalink filter. Below you have the docs ...


0

Ok, found the (a?) solution. "rewrite" => array( "slug" => "activity", "with_front" => false ), and function my_injecter_agence_in_activite_url( $post_link, $id = 0 ) { $post = get_post( $id ); if ( $post->post_type == 'activity' || 'publish' == $post->post_status ) { $terms = ...


Top 50 recent answers are included