-
AuthorPosts
-
July 6, 2021 at 5:01 pm #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/NKXmktdThe second feature, i would like to have
– the Categorce above the headline
– button / link below the text linked to the full articleIn the Masonry settings i have chosen the first order option, others does not fit to my design.
July 7, 2021 at 12:19 pm #1309081Hey 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,
IsmaelJuly 7, 2021 at 9:47 pm #1309161I 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 autoJuly 9, 2021 at 5:25 pm #1309424July 11, 2021 at 7:14 pm #1309600Hi,
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,
MikeJuly 12, 2021 at 10:54 am #1309713Hallo Mike,
thanks for taking this issue. But it seems that your code has a bug, Drupal does not let me save itJuly 12, 2021 at 11:52 am #1309740Hi,
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,
MikeJuly 12, 2021 at 12:18 pm #1309747My 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, 5 months ago by xeovision.
July 12, 2021 at 1:59 pm #1309774Hi,
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 -
AuthorPosts
- The topic ‘Masonry alignment’ is closed to new replies.