Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey
    I had the same problem and solved it with a filter for the WP_Query object, and a filter for the links.

    function alter_the_query_visitalocal( $request ) {
    
    	if($request['pagename']=='the-slug-you-like') return array('post_type' => 'job_listing');
    
    	return $request;
    }
    add_filter( 'request', 'alter_the_query_visitalocal' );

    And another filter for the links:

    add_filter('post_type_archive_link', 'change_url', 10, 2);
    /*Change at which page you arrive if you click the search button*/
    function change_url($link, $post_type){
    	if($post_type=='job_listing') return str_replace("/listing-region/", "/region/", $link);
    	return $link;
    }

    Put these into your functions.php, I hope it works

    it dont work for me

    It doesn’t work for me too ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing URL – /listing-region/’ is closed to new replies.