Search Function – change the layout and information

Home Forums Calendar Products Community Events Search Function – change the layout and information

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1073368
    Aindreas
    Participant

    Hello (again),

    I came across an issue (well, my client did, right while I was sitting next to him) relating to the search feature on wordpress.

    The issue is this:
    When searching the site for a specific event in the search bar the results are displayed poorly (featured image stretched, and the text stuck underneath), and the only date displayed is the posted date, so there is no information regarding price, date, time, location etc.
    It also displays events which have already occurred.

    Is there a plugin you offer to fix this issue, or is there some information you could give me to help style the search results to look more like the ‘Upcoming Events’ list? – I should have no problem styling it to suit my needs, but I need to display additional information.

    Any help would be greatly appreciated!

    Kind Regards,
    Aindreas

    PS: I am aware that this is an issue you cannot fix for me, but a nudge in the right direction for changing this would be very helpful!

    #1073975
    Nico
    Member

    Hey Aindreas,

    Thanks for reaching out on this, I can see there’s a good point in here…

    Let’s break this into three points:

    1. Look and feel: this will depend on your theme of course, and fixing this should be mostly a matter of CSS customization.
    2. Displayed information: to better display event information (price, venue, etc), you’ll need to customize the search page loop and add some conditionals. For example:

      // search results loop
      while ( have_posts() ) : the_post();

      if ( get_post_type() == 'tribe_events') {
      // it's an event let's show some extra info
      } else {
      // not an event
      }

      endwhile;

    3. Search Query: to exclude past events, or customize the results in other ways you’ll need to use the pre_get_posts hook. Take a look at this example: limiting it to a single post type.

    Please let me know if this helps and if you need further assistance with any point,
    Best,
    Nico

    #1084388
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Search Function – change the layout and information’ is closed to new replies.