Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array(
- function wptuts_custom_tags() {
- add_rewrite_rule("^brand-([^/]+)?",'index.php?post_type=products&brand_name=$matches[1]','top');
- flush_rewrite_rules();
- function my_post_type_link_filter_function($post_link, $id = 0, $leavename = FALSE) {
- if (strpos('%brand_name%', $post_link) === FALSE) {
- $post = &get_post($id);
- $brand_name =get_post_meta($post->ID,'brand',true);
- if(empty($brand_name)){$brand_name = 'default';}
- $post_link = str_replace('%brand_name%',$brand_name, $post_link);
- return $post_link;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement