WordPress Custom Post Type AJAX Search

7,166

10

3

Introduction: WordPress Custom Post Type AJAX Search

This is a 5 part tutorial explaining how to do a Custom Post Type AJAX Search.

Step 1: Setup

Step 2: Creating User Interface (PHP / HTML)

Step 3: JQuery (JS)

Step 4: AJAX Callback With JSON (PHP)

Step 5: Connect Frontend With Backend (JS)

Be the First to Share

    Recommendations

    • The 1000th Contest

      The 1000th Contest
    • Battery Powered Contest

      Battery Powered Contest
    • Hand Tools Only Challenge

      Hand Tools Only Challenge

    3 Discussions

    0
    mwhiteley16
    mwhiteley16

    1 year ago

    Really great tutorial. One note...make sure to add dataType : 'json' to the success response if you aren't using the plugin you mentioned to render json object automatically or it returns an array instead of an object. Great stuff!

    0
    nayanmoni
    nayanmoni

    Question 1 year ago on Step 1

    I can't fetch the Custom field value dynamically.
    $bed = 0;
    if(isset($_GET['bed']))
    $bed = sanitize_text_field($_GET['bed']);
    $bath = 0;
    if(isset($_GET['bath']))
    $bath = sanitize_text_field($_GET['bath']);



    This code is not working for me. Please give me the solution.

    0
    amberrayh
    amberrayh

    5 years ago on Introduction

    Thanks for sharing these video tutorials. I hope we see more from you in the future!