Support » Plugins » Hacks » Custom value in friendly url

  • Hello, i have problem with custom friendly url. I need pass variable to url. I using tutorial `add_filter(‘rewrite_rules_array’,’my_em_styles_rewrite_rules_array’);
    function my_em_styles_rewrite_rules_array($rules){
    //get the slug of the event page
    $events_page_id = 152;
    $events_page = get_post($events_page_id);
    $my_em_rules = array();
    if( is_object($events_page) ){
    $events_slug = $events_page->post_name;
    $my_em_rules[$events_slug.’/styles$’] = ‘index.php?page_id=’.$events_slug.’&styles_page=1′; //styles list
    $my_em_rules[$events_slug.’/style/(\d+)$’] = ‘index.php?page_id=’.$events_slug.’&style_id=$matches[1]’; //single style
    return $my_em_rules + $rules;

    function my_em_styles_query_vars($vars){
    array_push($vars, ‘style_id’,’styles_page’);
    return $vars;

    function my_em_rewrite_flush(){
    global $wp_rewrite;
    but this don’t working. Have you any idea where is problem.
    I need a little help. Waiting for your reply.
    Thanks xammil

Viewing 1 replies (of 1 total)
  • Hey there,

    i did not try this, but maybe your having trouble because your calling a add_action(‘init’,’my_em_rewrite_flush’); after your filter, removing your filter ?

Viewing 1 replies (of 1 total)
  • The topic ‘Custom value in friendly url’ is closed to new replies.