• Resolved val-13Love

    (@val-13love)


    Hi

    I am currently using a PremiumPress theme on my site which I have recently discovered does not automatically include Event Manager listsings as part of its search. So I tried to add a search plugin but the theme does not like that either. However I have found a section in the themes class_search.php which says you can add a custom field to your search, but I don’t have a clue where to find the info required.

    Here’s the code:

    /**
    * Builds an custom field area for search form builder
    *
    * @param null|object $data
    */
    function custom_field( $data = null ) {

    global $CORE;

    $label = ”;
    $meta_key = ”;
    $link_key = ”;
    $field_type = ”;
    $values = ”;
    $data_type = ”;
    $compare = ”;
    $operator = ”;
    $help = ”;
    $alias = ”;

    if ( !is_null( $data ) ) {
    $label = $data->label;
    $meta_key = $data->key;
    $field_type = $data->field_type;
    $link_key = $data->link;
    $values = $data->values;
    $operator = $data->operator;
    $compare = $data->compare;
    $help = $data->description;
    $alias = $data->alias;
    }

    $style = ($field_type == ‘select’) ? ‘block’ : ‘none’;
    ?>
    <li class=”postbox closed”>
    <div title=”Click to toggle” class=”handlediv”></div>
    <h3 class=”hndle”>
       <span class=”label label-important”>Remove Field</span> // <span class=”label label-success”>Custom Field</span><span>
    <?php
    if ( !empty( $label ) ) {
    echo ‘ – ‘ . $label;
    }
    ?></span>
    </h3>
    <div class=”inside”>

    If anyone knows how to fill this or can offer any advise in it would really really be appreciated.

    Much thanks
    Val

    https://wordpress.org/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    try Events > Settings > Pages > Event List/Archives > Include in WordPress Searches =Yes

    Thread Starter val-13Love

    (@val-13love)

    Hi Angelo_nwl

    Thanks for the response, however I already have this selected.

    I recently changed from a WordPress theme to a PremiumPress theme, only to discover that the PremiumPress theme does not include custom post_type in it’s searches. This means the main bulk of my site is now no-longer searchable unless the above code is completed.

    If anyone is able to assist in its completion or can advise me where to find the info it would be appreciated.

    Thank you much
    Val

    Hi Val,

    Haven’t had chance to test it but the code given on the page should work fine: http://www.paulund.co.uk/include-all-custom-post-types-in-wordpress-search

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding Event Manager to a custom search’ is closed to new replies.