How to add filters above the jobs results

Hi,

I am looking to add some filters to the top of the jobs search results in a similar way to the Jobs and Pros section on WPMUDEV - https://premium.wpmudev.org/jobs/

Are there any options in the settings that can be set to achieve this type of filtering above the jobs results? (I know these options exist within the advanced search widget but I am looking at displaying these inline not in the search widget)

I currently have a default jobs view - but could change this to a simpler list view to simplify this.

Can you please advise if any options or suggested best method exists for tailoring the results to work with these filters.

Many thanks
Chris

  • Kasia Swiderska
    • Support nomad

    Hi Chris,

    Can you check the "Advanced Search" add-on? You can activate it in Jobs -> Settings -> General Settings tab.
    Then above you jobs list you will have link "Advanced Search" that will open popup with more options for search.
    Please let me know if this could work for you.

    Kind regards,
    Kasia

  • chris
    • The Crimson Coder

    Hi Kasia,

    Thanks for this, but i already have this active on a couple of sites and it doesn't give the right user experience. ( http://jobexpert.simplecsr.com/job/ )

    I am specifically trying to build a view with filters that are permanently present similar to the screen shot of the jobs and pros section attached originally.

    Can you advise if this is possible working with anything packages with the jobs and experts plugin... or am I best to look for an alternative custom post filtering solution and a new set of custom templates for the jobs archives and search results pages.

    Many thanks
    Chris

  • Kasia Swiderska
    • Support nomad

    Hi chris,

    I sorry for the delay! I've look for solution for you - and I was able to add advanced search permanently over the jobs listings (see screen).
    I've made 2 changes in theme and plugin code - and I use the widget with Jobs search to do that.
    1) I've add in my theme functions.php (I'm using Twentyfourteen theme) new sidebar

    register_sidebar( array(
    		'name'          => __( 'Advanced', 'twentyfourteen' ),
    		'id'            => 'my-custom-sidebar',
    		'description'   => __( 'Place for advanced search', 'twentyfourteen' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget'  => '</aside>',
    		'before_title'  => '<h1 class="widget-title">',
    		'after_title'   => '</h1>',
    	) );

    2) I've added this sidebar in plugin code, in jobs-plus/app/views/job-archive/main.php in place of basic search form (I removed code of form):

    <form method="get"
                      action="<?php echo is_singular() ? get_permalink(get_the_ID()) : get_post_type_archive_link('jbp_job') ?>">
                    <div class="search input-group input-group-lg has-feedback" role="search" id="mySearch">
                        <input style="border-radius: 0;box-sizing: border-box" name="query" value="<?php echo $search ?>"
                               type="search"
                               class="form-control job-query"
                               placeholder="<?php echo __('Search For Job', je()->domain) ?>"/>
    <span class="input-group-btn">
        <button style="border-radius: 0" class="btn btn-default" type="submit">
            <span class="glyphicon glyphicon-search"></span>
            <span class="sr-only">Search</span>
        </button>
      </span>
                    </div>
    
                    <?php do_action('jbp_job_listing_after_search_form') ?>
                </form>

    And put there only this:

    <?php dynamic_sidebar( 'my-custom-sidebar' ); ?>

    3) In Widgets I've added the "Jobs+ search" to new Sidebar I've created in step 1.

    I'm attaching the result on the screenshot.

    Please, let me know if this is what you where looking for.

    Kind regards,
    Kasia

    • Kasia Swiderska
      • Support nomad

      Hi chris,

      No, truth to be tell, there is no way to protect changed code of plugin from beign erased after update. In some cases changes can be done through filters and actions, but I didn't find any way to change it with actions.
      But I will flag developer for his feedback on this matter - and maybe he can give better way to do that.

      Kind regards,
      Kasia

  • Hoang Ngo
    • Code Slayer

    Hi there,

    We can move the Job Archive View to another folder outside of the plugin folder, example, copy the file jobs-plus/app/views/job-archive/main.php to wp-content/job-archive-main.php
    And then, add this code to your theme functions.php or use mu-plugins

    add_filter( 'ig_view_file', 'update_view_of_job_archive', 10, 2 );
    function update_view_of_job_archive( $view_path, $view ) {
    	if ( $view == 'job-archive/main' ) {
    		$view_path = ABSPATH . 'wp-content/job-archive-main.php';
    	}
    
    	return $view_path;
    }

    This will use the new file instead of the old, and you care safe to update the plugin :slight_smile:

    Best regards,
    Hoang

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.