woocommerce permalinks like “?p=%post_id%”
woocommerce permalinks like “?p=%post_id%”
woocommerce permalinks like “?p=%post_id%”
Permalink Structure Function This function constructs the permalink for the ‘guide’ post type, including all hierarchical terms, with added spaces for style consistency: function xx_guide_permalink_structure($post_link, $post) { if ( ‘guide’ === $post->post_type && $terms = get_the_terms( $post->ID, ‘guide-category’ ) ) { usort( $terms, function( $a, $b ) { return $a->parent – $b->parent; } ); // … Read more
Here are two ways to fix this: Use a Prefix for Single Posts: Modify your permalink structure for posts to include a prefix specifically for single posts. For example: guide/news/post/%postname%/ This way, single post URLs will look like site.com/guide/news/post/your-post-name/ and won’t match the blog list page pattern. Use a Separate Permalink Structure for the Blog … Read more
Accidentally Changed Permalink Structure
Custom permalinks for post formats
Removing /wp in Permalink URL of subdomain led to inaccessibility to WP Dashboard
To achieve the permalink structure http://example.com/product_title-sku, you need to adjust the way the SKU is appended to the product title in the permalink. The current code appends the SKU to the end of the URL. Instead, you need to modify it to include a hyphen between the product title and the SKU. Here is the … Read more
Append slug of each blog post with a hash based on a custom field
You were getting /video-demos-tours/post-name instead of /resources/post-name because the following line in your theme_build_post_args function is setting the rewrite slug to the post type slug (video-demos-tours): $args[‘rewrite’][‘slug’] = $slug; So you should fix that, but as for how, that is up to you. But then, although fixing that would give you the permalink structure you … Read more
I noticed that all problematic posts had their wp_yoast_indexable row updated a few months ago which exactly matched with when I ran a script to update all existing posts. It was something like this: $posts = get_posts($args); foreach ($posts as $i => $post) { $post_data = array( ‘ID’ => $post->ID, // other stuff ); wp_update_post($post_data); … Read more