How to do set post permalinks using 6 digit random unique function?
How to do set post permalinks using 6 digit random unique function?
How to do set post permalinks using 6 digit random unique function?
Change custom post type permalink to show name of post from another custom post type?
I got an answer on the WordPress forums. Here is the working code for those looking to do something similar: add_filter( ‘post_type_link’, ‘change_webinar_links’, 10, 2 ); function change_webinar_links( $link, $post) { if ( $post->post_type == ‘tribe_events’ && tribe_event_in_category(‘webinar’) ) { $link = trailingslashit( home_url(‘/webinars/’ . $post->post_name ) ); } return $link; } add_action( ‘init’, ‘webinar_rewrite_rule’, … Read more
WordPress disallows changing page to a specific permalink
Add the following code In your main hooks file (maybe in functions.php) add_action(‘init’, ‘my_custom_rewrite_rules’); Then add this function function my_custom_rewrite_rules() { // The rule // Input: archives/publications/countries/kenya // Output: archive-template.php?posttype=publications&taxo=countries&slug=kenya add_rewrite_rule(‘archives/publications/countries/([^/]+)/’, ‘archive-template.php?posttype=publications&taxo=countries&slug=$matches[1]’, ‘top’); // Flush the rules (to activate them) flush_rewrite_rules(); } To learn more about regex and rewrite rules, those links might help https://regexone.com/ … Read more
How to get functions.php work with postname permalink?
CPT does’t have much options for building custom permalinks. What you need can’t be done without custom coding and creating new rewrite rules, and handling permalink parsing. I have plugin for working with post types and taxonomies, and it includes options for custom permalinks and more. It is not a free plugin, but in many … Read more
Have a look at this https://kellenmace.com/remove-custom-post-type-slug-from-permalinks/ I use it with this plugin: Code Snippets By Shea Bunge This allows you to modify your functions.php file without having to directly edit it. This means WordPress core and theme updates won’t remove your changes. Finally, may I suggest you try using a staging plugin to make a … Read more
It sounds like you didn’t flush your permalinks. Remove what you wrote in your .htaccess. Set what you had that was working before in the custom section of the permalink settings %category%/%postname%.html, save it, select ‘plain’, save it, then change it to your new settings %category%/%postname% save it, select ‘plain’, save it, then go to … Read more
Custom Post Type Permalink empty