One custom post type with two different url structure base on taxonomy term
Please check this plugin https://wordpress.org/plugins/rewrite/ It says that this plugin can create custom rewrite without having to touch PHP code
Please check this plugin https://wordpress.org/plugins/rewrite/ It says that this plugin can create custom rewrite without having to touch PHP code
Remove Page Slug from URL
function my_custom_post_work() { $labels = array( ‘name’ => _x( ‘Store’, ‘post type general name’ ), ‘singular_name’ => _x( ‘Store’, ‘post type singular name’ ), ‘add_new’ => _x( ‘Add New’, ‘Store’ ), ‘add_new_item’ => __( ‘Add New Store’ ), ‘edit_item’ => __( ‘Edit Store’ ), ‘new_item’ => __( ‘New Store’ ), ‘all_items’ => __( ‘All Store’ … Read more
This exact piece of code works, the reason for redirect was some other plugin. To create as many child pages you want dynamically you just need to this just hook it to ‘init’ hook. add_action(‘init’,’my_custom_rewrite_rules’ ); function my_custom_rewrite_rules(){ add_rewrite_tag( ‘%make%’, ‘([^/]+)’ ); add_rewrite_rule(‘^cars/([^/]+)/?’,’index.php?make=$matches[1]’,’top’); //or To go to a published page. add_rewrite_rule(‘^cars/([^/]+)/?’,’index.php?pagename=page-slug&make=$matches[1]’,’top’); } If you want … Read more
You can use a slug, when you are registering the post type with register_post_type(). You can add this argument like this $labels = array( //… add the labels as you need ) ); $args = array( ‘labels’ => $labels, //add other options as you need ‘rewrite’ => array(‘slug’ => ‘view-promotion’) ); register_post_type( ‘promotion’, $args ); … Read more
Add a hidden input field to your form with name page and value my-wordpress-plugin, When the form is submitted it will be passed along with your other form data. <input type=”hidden” name=”page” value=”my-wordpress-plugin”>
Thanks @cybmeta for your hint. I searched my theme and found an other flush_rewrite_rules(true); on the init hook. I removed this and now the rule is being remembered. Seemingly, calling the function twice is breaking something. Doesn’t really make sense to me, but it works now, so whatever 🙂
It seems to be redirected to “http://www.zeekray.com/en/” . But you don’t have a folder like “/en”, as far as I can see here http://www.zeekray.com , where the folders are shown.
For the sake of anyone interested in the answer to this question, I am posting here the following answer that I received in the WordPress.org support forums. leejosepho graciously provided the following answer: Yes, that is possible. Save ‘http://dem0site.net‘ in both boxes at Dashboard > Settings > General, then cPanel-assign and -point your domain to … Read more
Just got a solution: Just add this code to your functions.php and replace ‘_metainfo’ by your meta information and ‘posttype’ by your posttype. function add_meta2url( $link, $post ) { $post_meta = get_post_meta( $post->ID, ‘_metainfo’, true ); if ( ‘posttype’ == get_post_type( $post ) ) { $link = $link . ‘#’ .$post_meta; return $link; } } … Read more