Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 881 through 890 (of 1,224 total)
  • Author
    Search Results
  • #62230

    In reply to: Custom search results


    Trevor
    Participant

    Hi, there are, in effect, three potential results templates in Shortcode mode for EACH form:

    Let us say the form has an ID of 6799.

    1. The plugin first looks in the theme folder, search-filter sub-folder for a file called 6799.php
    2. If it does not find that, THEN it uses the results.php file in that same folder
    3. If it does not find that it uses the results.php file in the plugin templates folder

    If you want to make the results template specific to a form, use the numbered option.

    #62225

    In reply to: Custom search results


    Anonymous
    Inactive

    One question, by changing the results.php you mean to change that file on the plugin or locally on the theme?. I ask because I want to know if this will affect all the Search Forms.

    Thanks for your kindly help Trevor.

    #62142

    Trevor
    Participant

    I suppose it might be, but you would need to code this yourself, and it would only work if the visitor had javascript enabled.

    If you were using the shortcode method, which use the results.php file, you could add code to check if only one result found, and if it was, output a simple javascript command to load that page. This Stack Exchange page shows what that might look like:

    http://stackoverflow.com/questions/7066527/redirect-a-user-after-the-headers-have-been-sent

    #62140

    In reply to: Remove "Page 1 of 1"


    Trevor
    Participant
    #62122

    In reply to: Custom search results


    Trevor
    Participant

    Good morning Rai

    To do the former option would be easier, in part.

    S&F Pro already has the option to sort results by Post Type, so all you need to do is to format the results differently.

    The standard results.php is structured like this:

    <?php
    while ($query->have_posts()) {
      $query->the_post();
    ?>
    OUTPUT THE POST HERE
    <?php
    }
    ?>

    Instead you would do:

    <?php
    while ($query->have_posts()) {
      $query->the_post();
      switch (get_post_type( get_the_ID() )) {
        case 'Post Type A':
    ?>
          OUTPUT THE POST HERE if it is Post Type A
    <?php
          break;
        case 'Post Type B':
    ?>
          OUTPUT THE POST HERE if it is Post Type B
    <?php
          break;
        case 'Post Type C':
    ?>
          OUTPUT THE POST HERE if it is Post Type C
    <?php
          break;
      }
    }
    ?>

    You would have a little bit more code if you needed to detect the start and end of the output of each post type (for example to start a background box or add a sub-title.

    As to sort options, I do not know.

    #62069

    Anonymous
    Inactive

    Hello,
    I want to remove this from the Search&Filter results.php file:
    Page <?php echo $query->query[‘paged’]; ?> of <?php echo $query->max_num_pages; ?><br />

    I just want it removed from the top of the page and not the bottom.

    Could you give me the code to put in my child-theme functions.php file to have it not show. I’m a beginner and not sure how to code it.

    Thank you,
    Joy

    #62023

    In reply to: Custom search results


    Anonymous
    Inactive

    Hi Trevor,

    What I was thinking was to conditionate the results.php depending on the template we will use and then print the results depending of the custom post types.

    I have a developer so, if you help to track a way to do it, we can do it.

    And I imagine if my idea is not makeable, the second option, to separate the page in differents tabs, each one with their one filters and results, right?.

    Help me to see the way Trevor.

    #62009

    In reply to: Custom search results


    Trevor
    Participant

    Great video.

    You want a series of results, from multiple post types, which would normally come out all mixed up, to be sorted and probably have a sub-title as each type starts?

    If you know what the custom post types are beforehand, and you use the shortcode method, which then gives you the use of the results.php file, the results come in an array. It must be possible to pre-sort that array before looping through it, and using local variables to detect when the post type changes (and insert the title at that point), and what it is for each post type, where you can use a php switch case structure to have different html output around the fields, and even different fields.

    But that is a lot of coding. Probably 15-20 hours, and that will not be cheap, not that I or Ross have any free time anyway 🙁

    #61870

    Anonymous
    Inactive

    I tried to fix it with help of the link you just sent, but unfortenately, I can’t find my theme folder at all. I thought I found a list with some of these folders (via Editor), but I wasn’t able to add another folder overthere. Furthermore, I couldn’t find a folder/file called: wp-content\plugins\search-filter\templates\results.php…

    #61852

    Anonymous
    Inactive

    Hi Trevor,

    Thanks for your fast reply! I already managed to place a second search form on a specific page. 🙂 However, obtaining image results as hyperlinks isn’t working yet. How and where should I edit the results.php template file?

    Kind regards,

    Stan Thijssen

Viewing 10 results - 881 through 890 (of 1,224 total)