Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
Filter Posts with Jquery Sliders

I have built a WP Admin side form to filter my Custom Post Type by data in Custom Fields. I used jQuery UI range slider to set a number range to search in and i can get the slider to show but i don't know how to get it to return the results.

JS:

<label for="myfield">My Field:
      <input id="myfield" readonly type="text" placeholder="Set Range" class="form-control" name="myfield" value="` + myfield + `" /></label>
      <div id="myfield-range"></div>
        <script>
          $( function() {
            $( "#myfield-range" ).slider({
              range: true,
              min: 0,
              max: 20,
              step: 0.01,
              values: [ 0, 20 ],
              slide: function( event, ui ) {
                $( "#myfield" ).val( "" + ui.values[ 0 ] + " - " + ui.values[ 1 ] );
              }
            });
            $( "#myfield" ).val( "" + $( "#myfield-range" ).slider( "values", 0 ) +
              " - " + $( "#myfield-range" ).slider( "values", 1 ) );
          } );
          </script>

PHP:

var myfield = '<?php echo $_GET['myfield'] ?>';

if (!empty($_GET['myfield']))
                $sql .= " AND EXISTS ( select * from wp_postmeta where post_id=fdlk_posts.ID 
                    AND meta_key = 'field_myfield' AND meta_value LIKE '%" . $_GET['myfield'] . "%')";
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!