Post FIlter By Texonomy
Thu Jul 06 2023 11:34:48 GMT+0000 (Coordinated Universal Time)
Saved by @gshailesh27
<?php //Template Name: Careers get_header("inner"); ?> <div class="pageWrapper" id="sticky-anchor"> <section> <div class="container my-5"> <div class="row justify-content-center"> <div class="col-xxl-7 col-xl-8 col-lg-10"> <h2 class="text-center sectionTitle green_txt fw-light"><?php the_cfc_field( "careers-page-single-fields", "careers-page-title" ); ?></h2> </div> </div> </div> </section> <section> <div class="carrearSearch py-4 py-sm-5"> <div class="container"> <form class="row carrear_form align-items-end"> <!-- <div class="col-12 mb-3 mb-sm-4"> <div class="carrear_search carrearBig_search"> <input type="text" placeholder="Search" class="form-control" name="title" value="<?php echo $_GET[ "title" ]; ?>"> <img src="<?php echo get_template_directory_uri(); ?>/images/search_icon.svg" width="20px" height="20px" alt=""> </div> </div> --> <!-- <div class="col-sm-6 col-lg mb-3 mb-sm-4"> <select class="form-control form-select" aria-label="Default select example" name="country"> <option disabled>Country</option> <?php $args = [ "taxonomy" => "jobcountry", "orderby" => "name", "order" => "ASC", ]; $cats = get_categories($args); foreach ($cats as $cat) { ?> <option <?php echo $_GET["country"] == $cat->name ? "selected" : ""; ?> ><?php echo $cat->name; ?></option> <?php } ?> </select> </div> --> <div class="col-sm-6 col-lg mb-3 mb-sm-4"> <select class="form-control form-select" aria-label="Default select example" name="location"> <option disabled>Select Location</option> <?php $args = [ "taxonomy" => "jobcity", "orderby" => "name", "order" => "ASC", ]; $cats = get_categories($args); foreach ($cats as $cat) { ?> <option ><?php echo $cat->name; ?></option> <?php } ?> </select> </div> <div class="col-sm-6 col-lg mb-3 mb-sm-4"> <select class="form-control form-select" aria-label="Default select example" name="category"> <option selected disabled>Select Job Category</option> <?php $args = [ "taxonomy" => "jobtype", "orderby" => "name", "order" => "ASC", ]; $cats = get_categories($args); foreach ($cats as $cat) { ?> <option ><?php echo $cat->name; ?></option> <?php } ?> </select> </div> <div class="col-sm-6 col-lg mb-3 mb-sm-4"> <select class="form-control form-select" aria-label="Default select example" name="language"> <!--<option selected disabled>Language</option>--> <option disabled>Select Language</option> <?php $args = [ "taxonomy" => "joblanguage", "orderby" => "name", "order" => "ASC", ]; $cats = get_categories($args); foreach ($cats as $cat) { ?> <option <?php if ($cat->name == "English") { echo "selected"; } ?> ><?php echo $cat->name; ?></option> <?php } ?> </select> </div> <div class="col-sm-12 col-md-6 col-lg-12 mb-4 mb-md-0 order-lg-2"> <div class="form-check form-switch form-switch-md"> <input class="form-check-input" type="checkbox" id="flexSwitchCheckChecked" name="wfh"> <label class="form-check-label" for="flexSwitchCheckChecked">Only Work-From-Home</label> </div> </div> <div class="col-sm-6 col-lg mb-0 mb-lg-4 order-lg-1"> <input class="searchbtn fade_anim" type="submit"> </div> </form> </div> </div> </section> <section class="py-5 carrear_bg"> <div class="container mb-5"> <?php if ( !isset($_GET["country"]) && !isset($_GET["location"]) && !isset($_GET["category"]) && !isset($_GET["language"]) && !isset($_GET["wfh"]) && !isset($_GET["title"]) ) { // $wpnew=array( // 'post_type'=>'job', // 'post_status'=>'publish','orderby'=>'ID','order'=>'ASC' // ); //'post_name__in' => ['post-slug'] } else { $wpnew = [ "post_type" => "job", "post_status" => "publish", "orderby" => "ID", "order" => "ASC", "s" => $_GET["title"], "jobcountry" => $_GET["country"], "jobcity" => $_GET["location"], "jobtype" => $_GET["category"], "joblanguage" => $_GET["language"], "jobwfh" => $_GET["wfh"], ]; } $newsquery = new wp_Query($wpnew); if ($newsquery->have_posts()) { while ($newsquery->have_posts()) { $newsquery->the_post(); ?> <ul class="hmIndustryListing carrear_listing"> <li class="animateThis fadeGrow"> <div class="row justify-content-between industryBox carrear_box"> <div class="col-lg-9 col-12 mb-4 mb-lg-0"> <h3 class="industryHead"><?php the_title(); ?></h3> <p><?php the_cfc_field( "job-post-type", "job-short-description" ); ?></p> </div> <div class="col-auto align-self-center"><a href="<?php the_permalink(); ?>" class="explore_btn">Apply Now</a></div> </div> </li> <?php } } else { echo ""; } wp_reset_postdata(); ?> </ul> </div> </section> <section class="pb-5 mt-5"> <div class="container animateThis fadeIn mb-5"> <div class="row justify-content-center"> <div class="col-lg-7"> <div class="carrear_testimonial"> <?php foreach ( get_cfc_meta("careers-page-testimonials") as $key => $value ) { ?> <div> <div class="carrear_testimonialPic"><img src="<?php the_cfc_field( "careers-page-testimonials", "testimonials-image", false, $key ); ?>" alt=""></div> <p><?php the_cfc_field( "careers-page-testimonials", "testimonials-comment", false, $key ); ?></p> <h4>- <?php the_cfc_field( "careers-page-testimonials", "testimonials-name", false, $key ); ?></h4> </div> <?php } ?> </div> </div> </div> </div> </section> <section class="mb-5 whyWork_wrp"> <div class="container mb-5 "> <div class="whyWork_pic animateThis fadeIn mb-5 mb-lg-0"> <div class="wwImgHolder"><img src="<?php the_cfc_field( "careers-page-single-fields", "careers-page-section-2-image" ); ?>"></div> </div> <div class="row justify-content-end"> <div class="col-lg-6 whyWork_txt animateThis slideLeft"> <div class="titleBox animateThis leftClip in-view mb-4"> <h2 class="titleFont titleFont2"> <?php the_cfc_field( "careers-page-single-fields", "careers-page-section-2-title" ); ?></h2> </div> </div> </div> </div> </section> </div> <?php get_footer(); ?>
Comments