Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 261 through 270 (of 1,224 total)
  • Author
    Search Results
  • #222871

    In reply to: Shortcode or Custom


    Trevor
    Participant

    If you do not want to dig in to the PHP of our results.php file, you could use this method:

    https://searchandfilter.com/documentation/3rd-party/post-grid/

    #222330

    Trevor
    Participant

    If you are using our Shortcode results method, you can customise the results.php file, where the HTML structure, divs etc, can be found. See here for how:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    #222287

    Anonymous
    Inactive

    OK – thx Trevor – I will investigate as suggested. Initially the S&F video on YouTube using a Demo Video example dated from 2014 triggered my interest. Out of curiosity, does this use the standard results.php? If not, can you share the results.php you used for this?

    #221969

    Trevor
    Participant

    If you are using the shortcode display results method, then customising the results.php will allow you to change what the results look like. I don’t have specific examples, but there are many snippets in these forums. If you have an idea of what you want to do, I can help you.

    #221944

    Anonymous
    Inactive

    Not being an expert in PHP, is it possible to point me to a few results.php examples and their corresponding results output? I want to see how to have the results show only the title of post, possibly adding the first four lines of a post, or adding a featured image of the post or media, like first photo found within the post when using the shortcode method of S&F.
    Thanks for your help in advance.

    #221894

    In reply to: Default query as emtpy


    Trevor
    Participant

    If you are using our Shortcode display results method, this is possible by modifying the results.php template to check if a search has been made. Otherwise, you would need to code something similar in your theme template.

    See this post for guidance:

    https://support.searchandfilter.com/forums/topic/how-to-have-results-only-show-when-search-form-is-used/#post-211969

    #221580

    Trevor
    Participant

    Having taken a long look at things, you would need to re-code the places in the results.php template where you use those two functions.

    I cannot see how those functions are fetching the term data by looking at that plugin code, so you would need to try standard WordPress coding protocols.

    For em_display_event_tags() this is accessing a taxonomy named event-tag. There are many examples of code snippets on how to do this on StackExchange, such as this simple snippet:

    foreach (get_the_terms(get_the_ID(), 'event-tag') as $event_tag_term) {
       echo $event_tag_term->name;
    }

    The dates are stored as a custom field, named _event_start_date

    These appear to be date/time stamps, e.g. 2019-10-29 00:00:00

    A snippet would look like this:

    $start_date = get_post_meta( get_the_ID(), '_event_start_date', true );
    // Check if the custom field has a value.
    if ( ! empty( $start_date ) ) {
        echo $start_date;
    }

    Of course, you may want a prefix/title, additional HTML, commas for lists etc, but the above should at least fetch the data for you to then process.

    #221482

    Trevor
    Participant

    OK.

    The alternative is to use our Shortcode method, which needs it own page to be made, then edit the results.php (as per our documentation), starting with the exemplar infinite scroll PHP template file.

    Just take it one step at a time, testing in between. You can port most of your code, but no need to do the query stuff.

    #221440

    Trevor
    Participant

    Do you need a different results.php file for each form, which would be the best way. That way, any coding you want to do can be specific to that form? All you do is name the file, fore example, 1234.php.

    #221003

    Anonymous
    Inactive

    Hi, Could you please point me in the right direction how to order S&F results by a custom taxonomy? I use the Shortcode Display Result Method and a custom results.php (“4455.php” in theme/searchandfilter/). All filters work fine, but the ordering needs to change. Think I need a custom function for that? Thanks in advance!

Viewing 10 results - 261 through 270 (of 1,224 total)