-
AuthorPosts
-
April 3, 2022 at 5:50 pm #1347066
Hi,
is it possible to style the flexible masonry portfolio to get a “looser” appearance like this? Perhaps like the fixed masonry via tags that produce a certain padding?
Thank you for suggestions.
Best regards,
Vera
- This topic was modified 2 years, 7 months ago by Vera.
April 4, 2022 at 6:46 am #1347093Hey Vera,
Thank you for the inquiry.
You can play around with the Styling > Masonry Settings > Size Settings and maybe adjust the padding around the masonry images a bit using css. Please provide the site URL in the private field so that we can check the element directly.
Best regards,
IsmaelApril 4, 2022 at 3:39 pm #1347158Hi Ismael,
Thank you for your suggestions. If you can tell me the class of the element to play with (by adjusting the padding), this would help. As I want the images to be shown with their proportional length and height I suppose I have to use the flexible masonry. But there I couldn’t find the right elements to adjust so that for example the image from a portfolio with the tag “portrait” does not fill up the whole width of a column but has a certain padding to the left and right.
Best regards,
VeraApril 5, 2022 at 10:46 am #1347232Hi,
Thank you for the update.
You can use this css code to adjust the padding around the masonry image.
.av-masonry-container .av-masonry-entry .av-masonry-image-container img { padding: 10%; }
To apply different padding values to different items, try to use the nth-child selectors.
Example:
.av-masonry-container .av-masonry-entry:nth-child(1) .av-masonry-image-container img { padding: 15%; }
The nth-child(1) selector in the css code above will target the first masonry item and adjust the padding of the image within it. More info about nth-child selectors can be found here.
// https://css-tricks.com/almanac/selectors/n/nth-child/
Best regards,
IsmaelApril 6, 2022 at 12:01 pm #1347401Hi Ismael,
thank you for the instructions. They work well.
Is it also possible to let an image with the tag “landscape” take the width of two columns like in the version for the fixed masonry?
Thank you.
Best regards,
VeraApril 8, 2022 at 11:43 am #1347693Hi,
Glad to know that the suggestions above are working. Regarding the image orientation, you can modify this code in the enfold/config-templatebuilder/avia-shortcode-helpers/class-avia-masonry.php file around line 605, but we are not sure how this would affect other masonry layouts.
if( $size == 'fixed' ) { if( ! empty( $attachment ) || ! empty( $before_content ) ) { if( $auto ) { $class_string .= $this->ratio_check_by_image_size( $attachment ); } if( $manually ) { $class_string .= $this->ratio_check_by_tag( $entry['tags'] ); } } }
You can remove the condition $size == ‘fixed’ completely or just replace it with true.
if( true ) { // rest of the code }
Best regards,
IsmaelApril 18, 2022 at 12:28 pm #1348679Hi Ismael,
this has no effect on the orientation. An image taged as landscape still takes only the width of one column. Do I have to adjust perhaps also some css?
Thank you.
Best regards,
VeraApril 19, 2022 at 10:13 am #1348746Hi,
Sorry for the delay. Try to replace the whole code block with the following code.
$class_string .= $this->ratio_check_by_tag( $entry['tags'] );
This modification should check for the orientation tags and apply the appropriate class name to the masonry items regardless of the other conditions.
Best regards,
IsmaelApril 19, 2022 at 5:15 pm #1348832Hi,
it works! Thanks a lot for your great support!
Best regards,
VeraApril 19, 2022 at 6:32 pm #1348849Hi,
Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardApril 21, 2022 at 10:56 am #1349009Hi Rikard,
yes thank you, you can close this topic.
Best regards,
VeraApril 21, 2022 at 12:33 pm #1349018Hi,
Thanks for letting us know, I’ll close this thread for now then. Please open a new thread if you should have any further questions or problems.
Best regards,
Rikard -
AuthorPosts
- The topic ‘Styling Masonry Portfolio’ is closed to new replies.