Add sku to product url woocommerce [closed]

looks like this will do what you want just write out a custom function for it: Custom field values in permalink something like this: as the link says: function jpb_custom_meta_permalink( $link, $post ){ $post_meta = get_post_meta( $post->ID, ‘<insert your meta key here>’, true ); if( empty( $post_meta ) || !is_string( $post_meta ) ) $post_meta=”<insert your … Read more

Use the same date-based permalink structure for all post types

You’ll need to add the year, month, and day portions to the post’s permalink in your post_link callback: $link = str_replace( “https://wordpress.stackexchange.com/” . $pto->rewrite[ ‘slug’ ] . “https://wordpress.stackexchange.com/”, “https://wordpress.stackexchange.com/” . get_the_time( ‘Y/m/d’, $post ) . “https://wordpress.stackexchange.com/”, $link ); This will return a permalink such as example.com/2014/07/02/post-name. You’ll have to adjust the logic in your pre_get_posts … Read more

Auto setup “permalink” or request notice

You can check if the user has left it on the default, i.e. not chosen a permalink scheme, by testing if get_option( ‘permalink_structure’ ) is empty. I don’t think it’s polite to just change the user’s option for them, especially since they’ll need to update their .htaccess or equivalent before it’d actually work. Here’s a … Read more