How to make “single post” permalink maintain it’s sub-page structure
How to make “single post” permalink maintain it’s sub-page structure
How to make “single post” permalink maintain it’s sub-page structure
here is a solution to search through all categories, not only the first one. add_filter(‘post_link’, ‘custom_permalink’, 10, 2); function custom_permalink( $permalink, $post ) { // Get the categories for the post $categories = get_the_terms($post->ID, ‘category’); if (!empty($categories)) { foreach ($categories as $category) { if ($category->cat_name == “ICO”) { $cat_name = strtolower($category->cat_name); $permalink = trailingslashit( home_url(“https://wordpress.stackexchange.com/” … Read more
Try disabling all plugins temporarily (you can do that quickly by renaming the wp-content/plugins folder to something else). See if that fixes the admin screen. If it does, make a new wp-content/plugins folder, then move plugin folders from the renamed folder back into the wp-content/plugins folder one at a time. Retest, and see if one … Read more
You just need to set the permalink Custom Structure with the value blog/%postname%/
I think you have to create your own rewrite rule for that custom post type. Example creating a rewrite rule : function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘reviews/(.+)/(.+)’ => ‘index.php?post_type=movies&taxonomy_name=”.$wp_rewrite->preg_index(1).”&post_name=” . $wp_rewrite->preg_index(2) ); $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules; } // refresh/flush permalinks in the dashboard if this is changed in any way add_filter( … Read more
You would at least need to create one page where you can list all the info. In the php template for that page, you can then change that info based on the page you’re linking from. That would be the same link for all pages though (you could get around that with rewrite rules, but … Read more
At the end it was because I wasn’t writing a product base. So, after writing a product base like /product/%parent_category%/%keyword% everything worked fine. Besides, I used a plugin called Woocommerce Permalink Manager to remove the “product” from the URL.
I ended up adding this code that makes the default post type hierarchical and populating the wp_posts.post_parent field with the author ID. The combination of these two has achieved the desired implementation of having the same slug across multiple authors. // Set post type “post” to be hierarchical $wp_post_types[‘post’]->hierarchical = 1; Source: https://stackoverflow.com/questions/10750931/wordpress-how-to-add-hierarchy-to-posts
That is called canonical redirect. And it’s done through redirect_canonical() which basically Redirects incoming links to the proper URL based on the site url. and Will also attempt to find the correct link when a user enters a URL that does not exist based on exact WordPress query. (Those excerpts were both taken from the … Read more
postID/postname should work faster. Had a similar dilema and it turned out WordPress did all the 301 redirects automatically: Changing pemalink structure to /%post_id%/%postname%/ Didn’t measure any rating or traffic drop. However, in the first week, page load time did increase because of most visits being redirected. After that, all fine. Make sure to change … Read more