Sabina Ramsey

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: Filter bar not showing up while logged into WordPress #1432313
    Sabina Ramsey
    Participant

    This reply is private.

    in reply to: Filter bar not showing up while logged into WordPress #1428452
    Sabina Ramsey
    Participant

    And the filter bar also appears to not load on mobile either.

    in reply to: Filter bar not showing up while logged into WordPress #1428444
    Sabina Ramsey
    Participant

    Sorry trying to edit my first message but I’m getting a “ERROR: Forum ID is missing.” Please ignore the second paragraph, I’m still testing and the button seems that it will work, but the filter bar is still missing when logged in.

    in reply to: Filter bar not showing up while logged into WordPress #1428443
    Sabina Ramsey
    Participant

    This reply is private.

    in reply to: Filter results more specific #1333441
    Sabina Ramsey
    Participant

    I actually found on the user voice page than an Admin had posted a code snippet that works for this: https://gist.github.com/cliffordp/eb2753491526b079ba69882f4be4fafc and it seems to work great. I upvoted the feature as well for being a built-in option with the filter bar.

    in reply to: Exclude past events from WP search #1329018
    Sabina Ramsey
    Participant

    I kept searching around online for anyone else who was trying to accomplish this and it seems that this code works, just wanted to share it for anyone else trying this.

    // Exclude past events from search
    function mySearchFilter($query) {
        if ($query->is_search) {
            $past_events = tribe_get_events( array(
              'posts_per_page' => -1,
              'end_date' => new DateTime()
            ) );
            $exclude_events = [];
            foreach ( $past_events as $past_event ) {
                $exclude_events[] = $past_event->ID;
            }
            $query->set('post__not_in', $exclude_events);
        }
        return $query;
    }
    add_filter('pre_get_posts','mySearchFilter');
    • This reply was modified 8 years, 8 months ago by Sabina Ramsey.
    in reply to: Exclude past events from WP search #1328993
    Sabina Ramsey
    Participant

    This reply is private.

    in reply to: Exclude past events from WP search #1323466
    Sabina Ramsey
    Participant

    I’ve added that code, tried flushing out the cache and checked again and I am still seeing past events.

    in reply to: Exclude past events from WP search #1322661
    Sabina Ramsey
    Participant

    Actually sorry scratch that error, I figured out what that was from, but it seems that I’m still seeing some past events show up if I search for their title.

    in reply to: Exclude past events from WP search #1322339
    Sabina Ramsey
    Participant

    I tried adding that code with and with the search plugin I had been attempting to use (Relevanssi) deactivated and activated I was getting this error when I clicked to search:

    Fatal error: Uncaught Error: [] operator not supported for strings in /home/sitename/public_html/dev/wp-content/themes/polyclinic-child/functions.php:161 Stack trace: #0 /home/sitename/public_html/dev/wp-includes/class-wp-hook.php(298): edcny_pre_get_posts(Object(WP_Query)) #1 /home/sitename/public_html/dev/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array) #2 /home/sitename/public_html/dev/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #3 /home/sitename/public_html/dev/wp-includes/class-wp-query.php(1683): do_action_ref_array(‘pre_get_posts’, Array) #4 /home/sitename/public_html/dev/wp-includes/class-wp-query.php(3248): WP_Query->get_posts() #5 /home/sitename/public_html/dev/wp-includes/class-wp.php(617): WP_Query->query(Array) #6 /home/sitename/public_html/dev/wp-includes/class-wp.php(735): WP->query_posts() #7 /home/sitename/public_html/dev/wp-includes/functions.php(955): WP->main(”) #8 /home/sitename/public_html/dev/wp-blog-header.php(16): in /home/sitename/public_html/dev/wp-content/themes/polyclinic-child/functions.php on line 161

    in reply to: Move "View More" button #1105417
    Sabina Ramsey
    Participant

    Definitely thought I had already tried that but it worked! Thank you!

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