Custom post type permalink structure

function myrules(){ add_rewrite_rule(‘^yourcptslughere/([^/]*)/([^/]*)/([^/]*)/?’,’index.php?p=$matches[1]&taxonomy=$matches[2]&name=$matches[3]’,’top’); } add_action(‘init’,’myrules’); Replace the ‘yourcptslughere‘ with what you wanted, and then add that to functions.php then flush your rewrite rules, and the final example you posted should work. I doubt it will be what the_permalink() returns however so you will have to construct the urls yourself, however they should be viewable at … Read more

help with rewrite_tag and rewrite_rule for custom page GET variables [duplicate]

You should use get_query_var rather than $_GET. But you will need to register you custom variables, for instance: add_filter(‘query_vars’, ‘register_my_query_vars’ ); function register_my_query_vars( $qvars ){ //Add these query variables $qvars[] = ‘video_id’; $qvars[] = ‘vide_title’; $qvars[] = ‘venue_src’; return $qvars; } Then you should be able to use get_query_var(‘venue_id’).

WordPress custom permalinks, pages are now 404

You need to setup your permalinks for menutype using custom rewrite rules. What you’ve done is apply the menutype prefix to everything, even though menutype isn’t relevant to everything, so things are being misinterpreted. You would need something similar to this: function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘([^/]+)(/[0-9]+)?/?$’ => ‘index.php?menu_type=”. $wp_rewrite->preg_index(1).”&post_name=”. $wp_rewrite->preg_index(2) ); … Read more

New rewrite rules for custom taxonomy and reuse default

Note that the url-rewriting doesn’t directly determine the template used. A pretty url is interpreted as a query and then that query determines what template is used based on the template hierarchy. So only need one rule: example.com/localdeals/myterm => example.com/?location=myterm WordPress will look for the template taxonomy-location-myterm.php and use that (if it exists) or otherwise … Read more

WordPress Rewrite Rules

First you have to filter query vars and add your query var to the array: add_filter( ‘query_vars’, ‘wpa56345_query_vars’ ); function wpa56345_query_vars( $query_vars ){ $query_vars[] = ‘cat_id’; return $query_vars; } Then your rule which captures any digits after your pagename coupons and passes that as cat_id: add_action( ‘init’, ‘wpa56345_rewrites’ ); function wpa56345_rewrites(){ add_rewrite_rule( ‘coupons/(\d+)/?$’, ‘index.php?pagename=coupons&cat_id=$matches[1]’, ‘top’ … Read more

Custom Taxonomy in Permalink from post type

Set your taxonomy slug to taxonomy_name and in your post type set the slug to taxonomy_name/%taxonomy_name_term% and flush rewrite rules (simply by going to permalink settings panel in the admin) And after that WordPress will be able to handle /taxonomy_name/%taxonomy_name_term%/post-name/ URLs. So all that is left to do is tell WordPress what %taxonomy_name_term% means and … Read more

Rename page URL

I have tried some add_rewrite_rule magic and query variables and it worked. Thanks for the help everyone. If in case anyone want to refer the answer: add_filter( ‘query_vars’, ‘wpse26388_query_vars’ ); function wpse26388_query_vars( $query_vars ){ $query_vars[] = ‘custom_gallery_id’; return $query_vars; } add_rewrite_rule( ‘topic/([^/]+)/([^/]+)/gallery/([0-9]+)/?$’, ‘index.php?pagename=gallery&custom_gallery_id=$matches[3]’, ‘top’ ); I was able to solve my problem with this.

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