0

I need some help with my search function. What I want is a search function that search on the post title and on my meta values.

The meta values works but how can I add the post title to this query?

<?php
$args = array(
    'post_type'  => 'catalog',
    'meta_query' => array(
        array(
            'key'     => 'catalog_item_creator',
            'value'   => $_GET['searchtext'],
            'compare' => 'LIKE',
        ),
        array(
            'key'     => 'catalog_item_sku',
            'value'   => $_GET['searchtext'],
            'compare' => 'LIKE',
        ),
        'relation' => 'OR',
    )
);
$the_query = new WP_Query( $args );
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.