Forums Forums Search & Filter Pro Search Categorie and Taxonomie Results

  • This topic has 7 replies, 2 voices, and was last updated 11 years ago by Anonymous.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #12501

    Hi Ross,

    Hope you are well!

    I have written to you awhile ago, but haven’t received any response which is ok as back then I still had time before my client’s project launches. We are nearly there however I am all puzzled on how to configure your plugin to work the way we want. Basically, the website is a theatre review site. We want your plugin to allow visitors to search both with keywords and additional fields like reviewer, star rating, and also to be able to search just by using reviewer field and star rating field or both in combination without entering a keyword.

    Currently, if a keyword is not entered and reviewer/star rating field is also untouched it will return general results based on all categories of the site. But when a keyword is not entered and reviewer/rating field is selected it returns no results. That’s where we have a problem.
    For example, someone comes in to the site and wants to read reviews of reviewer named Michael so one selects Michael’s name from dropdown and pressed search, but reviews in the results appear of all of the reviewers on that site. It only returns correct results when keyword is entered which is very strange and something I cannot understand the purpose of.

    The search basically doesn’t allow to use any other field on its own and it has to go with a keyword. The same happens with searching events. No other fields relating to events (custom post type) can be used without using keyword which makes the whole search functions pretty much useless.

    This problem is the only one that stands between now and the launch of the website.

    I did and still do have high hopes for your plugin as it’s quite versatile and flexible and suited my project quite well with its functionality, just this problem stands on my way.

    I really hope you can help me in figuring out the way and making your plugin work.
    If you need to have a look inside the admin let me know and will create access for you.

    Thanks for your help in advance, Ross! I really appreciate that!

    Best,
    Timur

    Ross Moderator
    #12514

    Hey Timur

    I’ve added some new info to the FAQs covering a common problem with users’ themes and themes which do not use WordPress standards:

    http://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/#h-bad-template

    Let me know if this helps?

    Thanks

    Anonymous
    #12516

    Hey Ross!

    Thanks for a prompt reply!

    I will read it and will try following your instructions in it.

    I will let you know how it goes! Thanks!

    Timur

    Anonymous
    #12616

    Hey Ross!

    I tried to follow your instructions but couldn’t find any queries as you mention in FAQ.

    Here is how search.php file looks like in the theme that I am using:

    <?php

    get_header();
    $cb_global_color = ot_get_option(‘cb_base_color’, ‘#eb9812’);
    $cb_theme_style = ot_get_option(‘cb_theme_style’, ‘cb_boxed’);
    ?>

    <div class=”cb-cat-header<?php if ($cb_theme_style == ‘cb_boxed’) echo ‘ wrap’; ?>” style=”border-bottom-color:<?php echo $cb_global_color;?>;”>
    <h1 id=”cb-search-title”><?php _e(‘Search Results for:’, ‘cubell’); ?> <span style=”color:<?php echo $cb_global_color; ?>”>”<?php echo esc_attr(get_search_query()); ?>”</span></h1>
    </div>

    <div id=”cb-content” class=”cb-search-page wrap clearfix”>

    <div id=”main” class=”clearfix” role=”main”>

    <?php if (have_posts()) {

    get_template_part(‘cat’, ‘style-b’);

    } else { ?>

    <article id=”post-not-found” class=”hentry clearfix”>
    <h2><?php _e(‘Sorry, nothing found.’, ‘cubell’); ?></h2>

    <section class=”entry-content”>
    <p><?php _e(‘Please try searching again, but with different keywords.’, ‘cubell’); ?></p>
    </section>
    <footer class=”article-footer”>
    <p><?php get_search_form(); ?></p>
    </footer>
    </article>

    <?php } ?>

    </div> <!– end #main –>

    <?php get_sidebar(); ?>

    </div> <!– end #cb-inner-content –>

    <?php get_footer(); ?>

    I hope that will give you some ideas.

    Thanks,
    Timur

    Ross Moderator
    #12708

    Hey Timur

    Are you comfortable with making html/css changes to your template etc?

    I think at this stage it would be a more reliable to go with the shortcode method for displaying results.

    If not we can continue to work at this, but it looks like something else is then interfering with the search queries which we need to identify.

    Thanks

    Anonymous
    #12787

    Hey Ross,

    Yes, I am quite comfortable with making HTML/CSS changes.

    Do you mean going with shortcode method to display results as AJAX? If yes, than it wouldn’t really work for that website as search results template matches the website and there is not really space for AJAX to be performed for showing search results.

    I have spoken to a developer of the theme I am using and he pointed to a function that manipulates search results to show only posts or any custom posts, but not pages and if that function is removed it will revert to default search output. However, I did remove it but it didn’t affect the work of your search plugin. Here is that function:

    if ( ! function_exists( ‘cb_clean_search’ ) ) {
    function cb_clean_search($cb_query) {
    if ( ! is_admin() && ( $cb_query->is_search == true ) ) {

    if ( class_exists( ‘bbPress’) && ( is_bbpress() == false ) ) {

    $cb_cpt_output = cb_get_custom_post_types();

    $cb_query->set( ‘post_type’, $cb_cpt_output );
    }
    }
    return $cb_query;
    }
    }
    add_filter(‘pre_get_posts’,’cb_clean_search’);

    I can always give you access to admin if it’s going to help in any way.

    If we can make the search function to work as intended it would really be a big deal for me.

    Thanks for all you help, Ross!

    Timur

    Ross Moderator
    #12955

    Hey Timur

    I think we need to go shortcode way – but don’t worry – we still have complete customisation over the layout/results output.

    First, to setup and customise the output of the results you have to follow the instructions here:

    http://www.designsandcode.com/wordpress-plugins/search-filter-pro/docs/#docs-new-ajax

    Before customising, please check and make sure that the results are correct – and that hte plugin is functioning as you expected? Then proceed to the following steps.

    Once done, you will have an editable template for displaying your results – which is loaded into the page whereever the results shortcode is located. The next step (as you mentioned you were comfortable with html/css) would be to copy over the html structure of your search results template – replicating your search results template essentially inside the one we have just created.

    That should be all there is to it! If you followed the link above, it asked you to copy the results shortcode in to the page body as a test. If you want more flexibility (control over the html) why not create a custom page template for the page the shortcode can be found on (http://codex.wordpress.org/Page_Templates), and then use the wordpress function do_shortcode to position the results exactly where you want it in your html structure!?

    Hope that makes sense – its a shame the first method is not working out but the shortcode method was created specifically to get around problematic themes!

    Thanks

    Anonymous
    #13112

    Hey Ross!

    Thanks for directing me! I will try as you suggested, and if something I will let you know.

    Best,
    Timur

Viewing 8 posts - 1 through 8 (of 8 total)