- This topic has 5 replies, 2 voices, and was last updated 6 years, 11 months ago by Tom.
-
AuthorPosts
-
March 22, 2017 at 4:28 pm #296061Michael
HI
I am trying to displaying images fields via generatepress acf and flexbox.
The link below works on my webpage with html and css. However, when images are dynamic (acf) the images with flexbox just align in one column.
(flexbox original source: http://codepen.io/mazil/pen/ZbxBLa
1. I added the flexbox example (http://codepen.io/mazil/pen/ZbxBLa
) to my web page successfully and flexbox worked displaying images left to right in grid formation.2. Then i tried to add my custom image fields ‘profile_picture’ – The outcome was that images had containers but the flexbox displayed each item/image in one column? I can see the gallery css has ‘display: flex;’ but it’s broken?
<div class="container"> <?php $args = array( 'post_type' =>'artist',); $query = new WP_Query( $args ); ?> <?php if ( $query->have_posts()) : while ( $query->have_posts() ) : $query->the_post(); ?> <?php $attachment_id = get_field('profile_picture'); $size = "medium"; // (thumbnail, medium, large, full or custom size) $image = wp_get_attachment_image_src( $attachment_id, $size ); if ( $image ) { ?> <div class="gallery"> <div class="gallery--item"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <img class="gallery--image" alt="Image of <?php the_title(); ?>" src="<?php echo $image[0]; ?>" /> </a> </div> </div> <?php } ?> <?php endwhile; ?><?else: ?> <?endif; ?> </div>
March 22, 2017 at 7:55 pm #296106TomLead DeveloperLead DeveloperFlexbox can be super tricky to get working as it’s still pretty new.
Can you link me to what you have so far?
March 22, 2017 at 9:55 pm #296132MichaelHey Tom,
Good to hear from you. I am just working on this website locally.
I am able to get acf to return the image fields but flexbox just falls into 1 column.
regards
MichaelMarch 23, 2017 at 10:02 am #296372TomLead DeveloperLead DeveloperIt’s not really something I can help with without seeing the code/end result I’m afraid. Maybe let me know when you put it on a live server?
April 10, 2017 at 11:44 pm #304351MichaelHI Tom
I would really appreciate you offer to have a look at my test site with the working html.
Problem urls: (flexbox with acf including working flexbox example with html example – cat images)
1. weiv.com (Custom field: Artist – field: profile_picture)
file: content-page-artist.php (generatepress_child)
2. weiv.com/artist/megan/(Custom field: Artist->Gallery(repeater) ->gallerymeta-> image field
file: content-single-artist.php (generatepress_child)
April 11, 2017 at 10:00 am #304556TomLead DeveloperLead DeveloperWhat are you wanting it to look like? Any examples?
-
AuthorPosts
- You must be logged in to reply to this topic.