Staff Not Sorting Correctly or Lining up

Home Forums Mustang Staff Not Sorting Correctly or Lining up

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16587

    4BRDev
    Participant

    Staff Not Sorting Correctly or Lining up

    Resolved

    Hello –

    We have a directory located at http://www.4br.biz/our-members using a WM Posts / Custom Posts widget displaying wm_staff and a filter of staff_department.

    The filter is causing the display to make staff show up out of order and they’re no longer aligned at the top of each row.

    I’m using:
    count: -1
    Columns: 3
    Order: By name

    Everything works fine when I don’t use the filter, but I need the filter too.

    Please let me know how I can fix this.

    #16599

    Oliver Juhas
    Keymaster

    Hi,

    This is caused by masonry layout of the filter. To go around this, you can try using this code in your child theme‘s functions.php file:

    function child_theme_shortcode_attributes( $atts, $shortcode ) {
    	if ( 'posts' === $shortcode && 'wm_staff' === $atts['post_type'] ) {
    		// Force Isotope filter "fitRows" layout
    		$atts['filter_layout'] = 'fitRows';
    	}
    
    	return $atts;
    }
    
    add_filter( 'wmhook_shortcode__attributes', 'child_theme_shortcode_attributes', 20, 2 );

    For more info, the theme is using Isotope JavaScript library to provide the filtering functionality, which is set to masonry layout by default. That’s why you need to reset it to fitRows layout in this case.

    Best regards,

    Oliver Juhas
    WebMan Design

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

You must be logged in to reply to this topic.