Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

giveuptheghost

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • giveuptheghost in reply to:
    Adding button after category names, etc.
    #261164

    Ah, bummer. Ok, you can close this question. Thank you!

    giveuptheghost in reply to:
    Adding button after category names, etc.
    #260940

    IMG didn’t show for whatever reason. Here’s a link:

    https://ibb.co/fHrgsH4

    giveuptheghost in reply to:
    Can’t Get a Results Count with Oxygen Builder
    #259571

    Literally figured this out directly after posting this. I’ll post my solution for anyone interested.

    Here is the code I used in a PHP block to display the search term and a post count:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(678)->current_query();
    echo $sf_current_query->get_search_term();
    	
    $the_query = new WP_Query(array(
      'post_type' => 'courses',
    ));
    	
    echo $the_query->found_posts;
    wp_reset_postdata();

    Both before this code block and before the repeater that follows I put this shortcode (so twice):
    [searchandfilter id=”YOURSEARCHID” action=”filter_next_query”]

    I had tried this almost exactly last night (except without any arguments for $the_query) but it didn’t work. The trick was that I had to filter “$the_query” by at least one argument, in this case post_type. If I left the arguments empty or passed an empty $args, the searchandfilter shortcode wouldn’t filter. I’m assuming that shortcode is just a pre_get_posts based on the filter parameters and there needs to be at least one parameter for pre_get_posts to work.

    Either way, I believe I have it figured out – thanks for making a great plugin! It would be great to get more direct Oxygen Builder support in the future as it’s an amazing builder for people who can code but in the meantime, things are working so I’m happy!

    giveuptheghost in reply to:
    Can’t Get a Results Count with Oxygen Builder
    #259570

    I should have mentioned specifically, I am using Search and Filter Pro with an Oxygen repeater so I don’t have access to the query name. I am using [searchandfilter id=”YOURSEARCHID” action=”filter_next_query”] to filter the Repeater’s query.

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