Multiple meta key in search

  • Unknown's avatar

    I have a wordpress plugin which will search students result from database.IF i enter Roll number, It will display the result.Now, I would like to modify this as if i enter mobile phone number of student ,it should also show the result. The code is below.
    Mobile Number Meta_key is ‘info_3’

    enter // ResultPress search function
    function result_press_search() {
    if ( ! isset( $_POST[‘search’] ) )
    exit;

    query_posts(
    array(
    ‘posts_per_page’ => 1,
    ‘no_found_rows’ => true,
    ‘post_type’ => ‘rrf-result’,
    ‘meta_key’ => ‘roll’,
    ‘meta_value’ => wp_unslash( ( string ) $_POST[‘search’] ),
    ‘rrf_result_year’ => wp_unslash( ( string ) $_POST[‘result_year’] ),
    )
    );

    include_once( ‘templates/marksheet-theme-1.php’ );
    exit;
    }

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi @jaizal,

    Could you share the URL of the website you are looking for help?
    The site we have is – jaizal.wordpress.com.
    What is the Plugin name you are mentioning?

    Also, provide details what are you trying to do, we can then try and help you further.

    Thanks!

  • Unknown's avatar

    Thanks for reply @pavanraheja
    The URL is http://quranmusabaka.com/
    Plugin name “Resul Press”
    For , When i enter Roll number and search , The result appear. I need to search with Mobile number also.Mobile number Filed in database is “info_3”

  • Unknown's avatar

    Sorry for typo, The plugin name is “Result Press”

  • Unknown's avatar

    Hi @jaizal,

    Thanks for the details, your site is a Self-Hosted WordPress site, your best way to get help would be on the ORG forums, here is an as useful link where you can post your query for the Plugin:

    https://wordpress.org/support/plugin/resultpress

    This forum is just for WordPress.com folks. To know the difference, you can read more in this support document:

    WordPress Com vs WordPress ORG

    Best wishes to get a solution soon.

    Thanks!

  • The topic ‘Multiple meta key in search’ is closed to new replies.