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.

Custom Taxonomies in Post Grid and List Slider

  • Creator
    Topic
  • #2939
    Giagia
    Participant

    Hi Jason

    First of all awesome job with this theme and the framework.

    Second is it possible to create Post grid lists with custom taxionomies like in post list/grid?

    Third I was looking on the developer docs for customizing the login screen. Your customization (and this site also) looks good in chrome but the logo is stretched to the old logo dimension in safari.

    To solve the problem you have to change the css code, just adding a background-size in the css code

    .login h1 a {
            background: url(<?php echo get_stylesheet_directory_uri(); ?>/assets/images/logo.png) no-repeat;
            width: 440px;
            height: 170px;
            background-size: 440px 170px;
        }

    Thanks a lot

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

    Hello,

    When you’re doing any kind of post list/grid, you’ve got an option for a custom query string. So, you can pretty much do anything there that you could put a WP query string. — On the post grid/list page templates, you can add a custom field called “query”. On the post grid/list shortcodes, you can pass in a parameter called “query”. And on the post grid/list elements of the layout builder there should be an option that says “Custom Query.”

    post_type=your_post_type&your_taxonomy=your_term

    And thanks! I’ll checkout the login form thing.

    #2947
    Giagia
    Participant

    Hi Jason

    I’m trying to use the post list slider with a custom taxonomy in the Builder section and while I have found and used a Custom Query field even in the post grid and post list block I haven’t find it in post list slider.

    see image

    I’ve also try post_list_slider shortcode but didn’t work. It’s a pity because it should be a very nice feature also because it’s already supported by the other kinds of post list/grid.

    Thanks a lot

    • This reply was modified 7 years, 8 months ago by Giagia.
    • This reply was modified 7 years, 8 months ago by Jason Bobich.
    #2986
    Jason Bobich
    Keymaster

    The reason I don’t have this included because the query is more complicated with these sliders, and so it’s easier for the user to mess up. I’ll have closer look at it though for the next update.

    #2987
    Giagia
    Participant

    Thanks a lot Jason it’ll be an awesome implementation.

    So In the meanwhile “child-theme mode” on and I’ll try to do that by myself, even if I doubt I will make it works 😀

    Have a nice day

    #2992
    Jason Bobich
    Keymaster

    There is a filter there you can mess with. The $args is the array that gets passed to get_posts() for the post list/grid slider.

    function my_post_slider_args( $args, $options, $type, $current_location ) {
    
    	// $options -- All options passed from the Builder
    	// $type -- "grid" or "list"
    	// $current_location -- featured, main, featured_below
    
    	// Do whatever to $args
    
    	return $args;
    }
    add_filter( 'themeblvd_post_slider_args', 'my_post_slider_args', 10, 4 );

    The difficult part is coming up with a way to determine which post list/grid slider you’re filtering based on the variables you have available to you on this filter. One trick might be to incorporate some kind of secret key or word into one of the “query-related” options of the layout builder that you can check for in the $options array. And then since you’re in control of the query you could just make sure that doesn’t get used.

    An example might be to set the “Total Number of Posts” option to “my_key” and then look for that in your filter function.

    function my_post_slider_args( $args, $options, $type ) {
    	if( $type == 'grid' && $options['numberposts'] == 'my_key' ){
    		// Do whatever to $args
    	}
    	return $args;
    }
    add_filter( 'themeblvd_post_slider_args', 'my_post_slider_args', 10, 3 );
    #3070
    Giagia
    Participant

    Thanks Jason

    Nice advise I’ll definitely give it a try!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The forum ‘Swagger Responsive WordPress Theme’ is closed to new topics and replies.