• Resolved Allrounders

    (@allrounders)


    Hi,

    I’m using this plugin to make plant/herb and recipe website.
    There will be a lot of info, so I’ll need a good search functionality.
    Can you recommend a custom post search plugin that works well with this one?

    The ideal result would be a page where there is 3 sections of results, one per custom post type.

    Is there a way to make automatic links to for example other recipes (Custom post types) withe the same ingredients (meta box)?

    Regards,
    Remco

    https://www.ads-software.com/plugins/wck-custom-fields-and-custom-post-types-creator/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Razvan Mocanu

    (@razvanmo-1)

    Hi,

    Due to the way WCK stores custom fields, in order to allow search engines to find metabox fields data, you will have to install this plugin that unserializes fields.

    Having this covered, any search box that looks into custom fields would work with the data from CPT created with WCK.

    Regarding showing related posts based on common metabox fields, it is possible through some custom code. You will have to use get_post_meta, to refer to the custom field of a certain metabox.

    Here is an example:

    $meta_name_arg = 'recipe_metabox';
    $field_slug = 'ingredients';
    $n = 1;  //The index of a repeater field. In a single field use $n = 1
    
    $ingredients = get_post_meta( $post_id, $meta_name_arg . '_' . $field_slug .'_'. $n, true);

    Then use $ingredients to query for CPTs with the same post meta.

    Thread Starter Allrounders

    (@allrounders)

    I will try that tomorrow.
    Thans a lot for the quick reply!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search and autolink’ is closed to new replies.