This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

[bug] Post Slider – Categories not Working

  • Creator
    Topic
  • #6951
    Sean Wilkins
    Participant

    I am playing around and learning Jumpstart and have run across a problem, when I insert a Post Slider and try to display only posts based on a category slug the results are not being limited to the specific slug I enter. If I enter a manual query it works, but not with the “Where to pull posts from?”/”Category” option. Am I missing something here?

    For this test I have 5 test articles in one category and 5 articles in another. I want it to display only the 3 most recent articles from one of these categorizes.

    thx

    -sean

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #6963
    Jason Bobich
    Keymaster

    Hello Sean,

    Thank you for pointing this out. I have tested what you’re describing and can confirm this is the defintely the case and you are correct. I apologize for this inconveniance. The “Post Slider” element was a huge new item we added in the recent updates this past week. I have found the issue and have determined it lies in the core theme framework and not in the Layout Builder or Sliders plugin. This will be fixed with the next update, Jump Start v1.0.3.

    And as you pointed out, a quick work-around here would just be to use the custom query string:

    category_name=your-category

    And if you also wanted to specify that only three posts show, you’d do it like this:

    numberposts=3&category_name=your-category

    Note: Make sure the numberposts comes before the category_name param.

    Additionally, if this is a crucial matter in setting up things for a client to use and you want a fix for the actual issue at hand until the next update, you can put this in your Child theme’s functions.php:

    /**
     * Temporary fix for Post Slider element not working 
     * with category selection. This issue will be resolved 
     * with Jump Start v1.0.3
     */
    function themeblvd_slider_auto_args_fix( $query_args, $args ){
    	switch( $args['source'] ) {
    		case 'category' :
    			unset( $query_args['tag'] );
    			if( ! empty( $args['category'] ) )
    					$query_args['category_name'] = $args['category'];
    			break;
    		case 'tag' :
    			unset( $query_args['category_name'] );
    			unset( $query_args['cat'] );
    			break;
    	}
    	return $query_args;	
    }
    add_filter( 'themeblvd_slider_auto_args', 'themeblvd_slider_auto_args_fix', 10, 2 );

    ===========

    For our internal reference: https://github.com/themeblvd/Jump-Start/issues/69 (private link)

    #6983
    Sean Wilkins
    Participant

    Thx, I couldn’t get the query to work completely. I could get it to show a number of articles OR a specific category (e.g. numberposts=3&category_name=articles didn’t work) but not both; however the code fix worked fine so I am good for the moment.

    thanks for the quick followup and troubleshooting.

    -sean

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.