Title: Slug/permalink structure
Last modified: August 22, 2016

---

# Slug/permalink structure

 *  Resolved [Sanjay](https://wordpress.org/support/users/sanjaysarraf/)
 * (@sanjaysarraf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/)
 * Hi,
 * how to set permalink as: [https://mysite.com/job/jobtitle-location](https://mysite.com/job/jobtitle-location)
   and not as [https://mysite.com/job/location-jobtitle](https://mysite.com/job/location-jobtitle)
 * another question is how to show job listing count by user/author on frontend 
   dashboard?
 * Thanks
 * [https://wordpress.org/plugins/wp-job-manager/](https://wordpress.org/plugins/wp-job-manager/)

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/slugpermalink-structure/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/slugpermalink-structure/page/2/?output_format=md)

 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866022)
 * [https://wpjobmanager.com/document/tutorial-changing-the-job-slugpermalink/#section-2](https://wpjobmanager.com/document/tutorial-changing-the-job-slugpermalink/#section-2)
 * > another question is how to show job listing count by user/author on frontend
   > dashboard?
 * Customise whatever adds the user/author and use [http://codex.wordpress.org/Function_Reference/count_user_posts](http://codex.wordpress.org/Function_Reference/count_user_posts)
 *  Thread Starter [Sanjay](https://wordpress.org/support/users/sanjaysarraf/)
 * (@sanjaysarraf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866065)
 * Hi, Thanks for reply, but [this](https://wpjobmanager.com/document/tutorial-changing-the-job-slugpermalink/#section-2)
   is not working. Actually this generates slug like this [https://mysite.com/job/location-jobtitle](https://mysite.com/job/location-jobtitle)
   but i need jobtitle first and location last in slug.
 * And for job listing count i am unable to figure it out. my code is <p class=”
   author-meta”>
    <span class=”listing-count”><?php printf( _n( ‘%d Jobs Created’,‘%
   d Jobs Created’, $wp_query->found_posts, ‘text-domain’ ), $wp_query->found_posts);?
   ></span>
 * but it is not working. please help.
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866071)
 * I know the snippet isn’t exactly how you asked – you have to modify it and re-
   aarrange the contents.
 * As for the other function, you’ve not even used the function I suggested. count_user_posts
   gets the count of jobs a specific user has posted.
 *  Thread Starter [Sanjay](https://wordpress.org/support/users/sanjaysarraf/)
 * (@sanjaysarraf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866073)
 * Alright. I have tried several times to modify it but did not get exactly what
   i want. please can you re-arrenge it for me? Thanks.
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866148)
 * Show me your latest attempt 🙂
 *  Thread Starter [Sanjay](https://wordpress.org/support/users/sanjaysarraf/)
 * (@sanjaysarraf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866149)
 * Hi, I have Succeeded in getting user post count. this worked for me:
 * <p class=”author-meta”>
    <span class=”listing-count”><?php printf( __( ‘%d Listing
   Created’, ‘wp-job-manager’ ), count_user_posts($current_user_id = get_current_user_id(),“
   job_listing” ) ); ?></span></p>
 * But with slug structure i failed.
 * I tried:
 * add_filter( ‘submit_job_form_save_job_data’, ‘custom_submit_job_form_save_job_data’,
   10, 5 );
 * function custom_submit_job_form_save_job_data( $data, $post_title, $post_content,
   $status, $values ) {
 * $job_slug = array();
 * $job_slug[] = $post_title;
    $data[‘post_name’] = implode( ‘-‘, $job_slug );
 * // Prepend location
    if ( ! empty( $values[‘job’][‘job_location’] ) ) $job_slug[]
   = $values[‘job’][‘job_location’];
 * return $data;
    }
 *  Thread Starter [Sanjay](https://wordpress.org/support/users/sanjaysarraf/)
 * (@sanjaysarraf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866150)
 * Hi, one more issue: with 10k categories, very slow database queries causing db
   errors or endless site loading. Using VPS with 2gb ram.
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866153)
 * What DB errors? There will be optimisations in the next update, but it may be
   something else if you get actual errors.
 *     ```
       $job_slug = array();
   
       $job_slug[] = $post_title;
       if ( ! empty( $values['job']['job_location'] ) ) {
         $job_slug[] = $values['job']['job_location'];
       }
   
       $data['post_name'] = implode( '-', $job_slug );
       ```
   
 *  Thread Starter [Sanjay](https://wordpress.org/support/users/sanjaysarraf/)
 * (@sanjaysarraf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866160)
 * Hi, Thanks, but this is not working. It is generating only [http://myssite.com/jobtitle](http://myssite.com/jobtitle)
 * but i need [http://myssite.com/jobtitle-lication/](http://myssite.com/jobtitle-lication/)
 * due to slow my sql queries site loading endless.
 * SELECT t.*, tt.*
    FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id
   = tt.term_id WHERE tt.taxonomy IN (‘job_listing_categories’) ORDER BY t.name 
   ASC W3_Db->default_query+ 0.0811 $wpdb Queries
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866162)
 * 0.08 is not a slow query.
 * Remember this code only affects new listings submitted from the frontend form.
   Not the admin.
 *  Thread Starter [Sanjay](https://wordpress.org/support/users/sanjaysarraf/)
 * (@sanjaysarraf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866164)
 * Ok but after disabling categories site works fine.
 * above slug snnipets is not working for me. It is generating only [http://myssite.com/jobtitle](http://myssite.com/jobtitle)
 * but i need [http://myssite.com/jobtitle-lication/](http://myssite.com/jobtitle-lication/)
 * Please help.
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866166)
 * This works fine, its tested [https://gist.github.com/mikejolley/8edf6429e265ee5cf715](https://gist.github.com/mikejolley/8edf6429e265ee5cf715)
 *  Thread Starter [Sanjay](https://wordpress.org/support/users/sanjaysarraf/)
 * (@sanjaysarraf)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866168)
 * Yes, Its working… You are my superhero. Many Thanks. 🙂
 * Just one issue with 10k categories slow database queries…
 * You are the man. Thank you Mike!
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866180)
 * Could it be the select box where you select a category on the search/submission
   forms? This outputs all categories..
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/#post-5866181)
 * Could it be the select box where you select a category on the search/submission
   forms? This outputs all categories..

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/slugpermalink-structure/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/slugpermalink-structure/page/2/?output_format=md)

The topic ‘Slug/permalink structure’ is closed to new replies.

 * ![](https://ps.w.org/wp-job-manager/assets/icon-256x256.gif?rev=2975257)
 * [WP Job Manager](https://wordpress.org/plugins/wp-job-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-job-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-job-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-job-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-job-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-job-manager/reviews/)

## Tags

 * [Permalink structure](https://wordpress.org/support/topic-tag/permalink-structure/)
 * [slug](https://wordpress.org/support/topic-tag/slug/)

 * 20 replies
 * 2 participants
 * Last reply from: [Sanjay](https://wordpress.org/support/users/sanjaysarraf/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/slugpermalink-structure/page/2/#post-5866191)
 * Status: resolved