How to change permalinks

Permalink settings are handled in wp-admin under Settings > Permalinks. You can select the “Post name” radio button and save the changes, and your permalinks will be updated. If this is a live indexed site, you may want to set up redirects for search engines and visitors – that’s the only part that would require … Read more

Broken wordpress site, non-working links and no access to wp-admin page

https://wordpress.stackexchange.com/ is the stackexchange website that deals with wordpress. It seems like your website is hosted by Automattic so you can get their help by communicating with their support staff. Go to https://wordpress.com/support/contact/ and click on “I need customer service for a paid site hosted at wordpress.com“ https://wordpress.com/support/com-vs-org/ WordPress is a free and open-source Content … Read more

Custom Post Type posts, conflict with posts after add_rewrite_rule to top

I think I solved my problem. So if you have your WordPress post permalink set to %category%/%postname%/, and you want this for custom post type and taxonomy, you could prepare your rewrite links for all generated taxonomy terms (cat-a, cat-b etc.). Code: add_filter( ‘rewrite_rules_array’, function($rules) { $categories = get_terms([‘taxonomy’ => ‘success-category’ ]); foreach ($categories as … Read more

Template for custom post type when taxonomy is in the URL

Your taxonomy’s rewrite base is actually book_types (see the “rewrite” => [ ‘slug’ => ‘book_types’, ‘with_front’ => true, ] in your code), so the taxonomy archive pages are accessible at the /book_types/<term slug> path.. and not /books/<term slug>. So it’s normal if /books/fiction shows a 404 error page, unless of course if there’s a post … Read more

Change product_base programmatically

Use your plugin activation hook to make the change. That will only run once, when your plugin is first activated, allowing the user to overwrite that change later (if they want to). register_activation_hook( __FILE__, function () { if ( $permalinks = get_option( ‘woocommerce_permalinks’ ) ) { $permalinks[‘product_base’] = ‘property’; update_option( ‘woocommerce_permalinks’, $permalinks ); flush_rewrite_rules(); } … Read more

Custom URL rewrites for templates

Since you want to add something to the end of every post/page rewrite rule, you probably can just add a rewrite endpoint. These are regexes of the form /[endpoint_name](/[optional_extra_stuff])? that are appended to the already generated rules for pages, posts, archives, … You define on which structures you want to add them by setting the … Read more

RSS feed link on archives page not working

I made a mess of this in comments, so will start from scratch. The feed links for archive pages are usually only outputted for browser detection by feed_links_extra(). From looking at its source there is number of different function to get link for the archive pages: get_category_feed_link( $cat_id ); get_tag_feed_link( $tag_id ); get_term_feed_link( $term_id, $taxonomy … Read more