• Resolved ypb2021

    (@ypb2021)


    Is it possible to list all job ads for a specific city on one page in WordPress via shortcode or function?

    Thanks for the help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @ypb2021

    Do you have an active Google Maps API or location field is filled only by the City?

    Let me know,
    Best Regards!

    Thread Starter ypb2021

    (@ypb2021)

    The location field is filled only by the city.

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @ypb2021

    Sorry for the delay, there is a default filter field on the jobs list page https://www.screencast.com/t/eY72zp891e

    If you need something custom there is a hook in WP_Query that we use for AJAX response.

    $query_args = apply_filters( 'jb_get_jobs_query_args', $query_args );

    There is an example of the code that you can use for the custom filtering by the city:

    $query_args['meta_query'] = array_merge( $query_args['meta_query'], array(
        'relation' => 'AND',
        array(
    	'relation' => 'OR',
    	array(
    	    'key'     => 'jb-location',
    	    'value'   => $location,
    	    'compare' => 'LIKE',
    	),
    	array(
    	    'key'     => 'jb-location-preferred',
    	    'value'   => $location,
    	    'compare' => 'LIKE',
    	),
        ),
    )

    Let me know if you have other questions,
    Best Regards!

    Thread Starter ypb2021

    (@ypb2021)

    Thank you very much!

    Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @ypb2021

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show jobs for a city by shortcode’ is closed to new replies.