Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1308951

    Hallo,
    i have an issue with the alignment of the Masonry images.
    As seen on the screenshot, i want to have them with full width and the height auto.
    https://ibb.co/NKXmktd

    The second feature, i would like to have
    – the Categorce above the headline
    – button / link below the text linked to the full article

    In the Masonry settings i have chosen the first order option, others does not fit to my design.

    #1309081

    Hey Sebastian,

    Thank you for the inquiry.

    What is the current masonry size settings? Please post the site details in the private field including the link to the page with the masonry element so that we could check it properly.

    Best regards,
    Ismael

    #1309161

    I have set the first option with flexible Masonery.
    It seems that the pics are fitted into the frame, i would like to have the, fit to width and the height auto

    #1309424

    @ismael Meanwgile i have solved the full width and the read more button.
    But i do not find a way to add the category below the headline

    • This reply was modified 3 years, 4 months ago by xeovision.
    #1309600

    Hi,
    Thank you for your patience, the masonry element doesn’t include the categories by default, but you can add this function to your child theme functions.php to add it:

    add_filter( 'avf_masonry_loop_prepare', 'avf_masonry_loop_prepare_mod_cat', 10, 2 );
    function avf_masonry_loop_prepare_mod_cat( $key, $entries )
    {
        $categories = get_the_category($key['ID']);
        $separator = ' ';
        $output = '
    <div class="masonry-cat">';
    	    if ( ! empty( $categories ) ) {
    	        foreach( $categories as $category ) {
    				if($category->slug == "whats-new" && is_page(13)) {
    					$output .= '<span alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</span>' . $separator;
    				} else {
    					$output .= '<span alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</span>' . $separator;
    				}
    	        }
    	    }
    	 $output .= '</div>
    ';
    
        $key['text_after'] .= trim( $output, $separator );
        return $key;
    }

    Best regards,
    Mike

    #1309713

    Hallo Mike,
    thanks for taking this issue. But it seems that your code has a bug, Drupal does not let me save it

    #1309740

    Hi,
    I hope you mean WordPress and not Drupal, we do not support Drupal. If WordPress won’t let you save it then you probably need to add it to your child theme functions.php via FTP.

    Best regards,
    Mike

    #1309747

    My fault, i mean WordPress :)
    OK, i will try with FTP but i will get the same save error everytime i add a new function. Any idea why WP wont accept this ocde?

    UPDATE: By FTP ..code is working fine, have changed
    $key[‘text_before’]
    …so got the position i need.

    Many Thanks

    • This reply was modified 3 years, 4 months ago by xeovision.
    #1309774

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Masonry alignment’ is closed to new replies.