Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter exingin

    (@exingin)

    The search worked after I unchecked Expired Positions under Settings – Jobs. Expired positions are now searchable in the admin panel.

    Unfortunately, the expired jobs also appeared in the frontend, so I added code to the functions.php of the theme to make them not show up in the frontend search:

    • /**Hide expired positions in frontend search
      */
      function hide_expired_positions_in_frontend_search( $args ) {
      // Check if the current query is a frontend search query
      if ( ! is_admin() && $args[‘post_type’] === ‘job_listing’ ) {
      // Modify the query to exclude expired positions
      $args[‘meta_query’][] = array(
      ‘key’ => ‘_job_expires’,
      ‘value’ => current_time( ‘mysql’ ),
      ‘compare’ => ‘>’,
      ‘type’ => ‘DATETIME’,
      );
      } return $args;
      }
      add_filter( ‘job_manager_get_listings’, ‘hide_expired_positions_in_frontend_search’ );

    Please developers – fix this bug in the next update of WP Job Manager!

    Thread Starter exingin

    (@exingin)

    You wrote about something completely different, it’s not about the job search page, it’s about the [job_dashboard] page.

Viewing 2 replies - 1 through 2 (of 2 total)