How to add custom rewrite rules and point to specific templates

You need to create query_var for sector and you need to create a rewrite rule with RegEX. I created a plugin for this. Create a file and add into the wp-content/plugins folder and activate it. <?php /* Plugin Name: Custom Rewrite Plugin URI: https://serkanalgur.com.tr Description: Custom Rewrite Version: 1 Author: Serkan Algur Author URI: https://www.serkanalgur.com.tr … Read more

add_rewrite_rule to remove /category/ from permalink

I believe the rewrite rule your wanting to alter is this category/(.+?)/?$ index.php?category_name=$matches[1] category to do what you want it should just be a case of adding the following rewrite rule in your functions.php add_rewrite_rule(‘(.+?)/?$’, ‘index.php?category_name=$matches[1]’, ‘top’); this should work but might conflict with other rules so that will be worth checking.

Redirect to another page using contact form 7? [closed]

Redirect to another page using contact form 7? [closed]

Add a permalink variable onto custom post type URL after post name slug

Here’s a complete working example that adds a post type, with extra rule to capture an additional parameter: function wpd_post_type_and_rule() { register_post_type( ‘mycpt’, array( ‘labels’ => array( ‘name’ => __( ‘mycpt’ ), ), ‘public’ => true, ‘rewrite’ => array( ‘slug’ => ‘mycpt’ ), ) ); add_rewrite_tag( ‘%mycpt_var%’, ‘([^/]*)’ ); add_rewrite_rule( ‘^mycpt/([^/]*)/([^/]*)/?$’, ‘index.php?mycpt=$matches[1]&mycpt_var=$matches[2]’, ‘top’ ); } … Read more

Custom rewrite rule ignored

The rewrite rules are correct, but because you are modifying the $wp_rewrite directly, you aren’t getting the benefit of being able to add the rule to the top of the stack using add_rewrite_rules. You are on the right track with the location of the rule in the array, but rules at the top are checked … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)