Get the custom post type slug but remove the rewrite prefix?
Get the custom post type slug but remove the rewrite prefix?
Get the custom post type slug but remove the rewrite prefix?
Try this. $locations = get_terms( ‘location’, ‘hide_empty=0&orderby=term_group’ ); The codex says to avoid using term_group but it should be fine. It was never fully implementet but, according to others, its used quite often.
You don’t need multiple taxonomies if all you want to do is customize the order in which they are rendered. A plugin like one of these can help your order your categories, tags and taxonomies: https://wordpress.org/plugins/taxonomy-terms-order/ https://wordpress.org/plugins/custom-taxonomy-order-ne/ Is there something more specific you are trying to achieve?
Removing or hiding slug/permalink from htaccess
I solved my problem. All I needed was the WordPress Rewrite API. if( ! function_exists(‘theme_add_rewrite_rules’) ){ function theme_add_rewrite_rules(){ add_rewrite_rule( ‘^blog/([^/]+)/?$’, ‘index.php?name=$matches[1]’, ‘top’ ); } } add_action( ‘init’, ‘theme_add_rewrite_rules’); This solves how wordpress will parse the URL. Half of the problem is how to modify the posts so that the links will not include the /en/ … Read more
When you use the graphical interface, post_name is stored in the wp_posts table even for draft posts as soon as you modify the default value. I tried your code (case 2) and I actually see the new entry in the database, with the correct post_name. Perhaps your check to post_name is not correct ?
To get URL like www.example.com/lp/time-cost/free-trial you need to create parent child pages. Create lp as parent page Create time-cost as child page of above (lp page) Create free-trial as child page of (time-cost) page Then if you access free-trial page you will get the URL like you want.
Can I override the permalink/slug on creation
You need post status transitions, and quite similar with this post: Detect type of post status transition only what you need to do update post title and slug, and this is easy. Update post examples Since you wrote like this: add_filter( ‘the_title’, ‘my_modify_title’, 10, 2 ); function my_modify_title( $title, $id ) { if( in_category( ‘My … Read more
Add priority with at least 1 to your add actions: add_action( ‘init’, ‘add_training_post_type’, 1 ); add_action( ‘init’, ‘create_training_taxonomies’, 1 ); Currently your issue is that your post type and taxonomy rewrite slugs are identical, so the URL base would be the same and it confuses WP. Fortunately there is easy solution, just add this code … Read more