Reply To: change masonry

The support forum is open for members only. To add a topic or reply in the forum, please login or register.

Support Forum Moved
The Pojo Themes support has been transferred to a faster and more personal ticketing platform, so the forums are no longer active.
  • If you want to learn how to use Pojo themes, check out our extensive documentation guides.
  • Need help with using our themes? Contact us with a detailed explanation of your issue in the support page.
  • Have a pre-sale question or other inquiry? Feel free to contact us about it.

Support › Forums › Support (Legacy) › change masonry › Reply To: change masonry

#1541
tzafi azran
Participant

i inserted the following php file into the child theme:

<?php
/**
 * Content: Gallery Masonry
 */
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $_pojo_parent_id;

$categories       = '';
$categories_terms = get_the_terms( null, 'pojo_gallery_cat' );
if ( ! empty( $categories_terms ) && ! is_wp_error( $categories_terms ) )
	$categories = wp_list_pluck( $categories_terms, 'name' );
?>

<div id="post-<?php the_ID(); ?>" <?php post_class( apply_filters( 'pojo_post_classes', array( 'grid-item gallery-item masonry-item col-md-3 col-sm-6 col-xs-6' ), get_post_type() ) ); ?>>
	<?php if ( $image_url = Pojo_Thumbnails::get_post_thumbnail_url( array( 'width' => '420', 'placeholder' => true ) ) ) : ?>
		<figure class="image-link">
			<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark">
				<img src="<?php echo $image_url; ?>" alt="<?php echo esc_attr( get_the_title() ); ?>" class="media-object" />
				<div class="overlay-image"></div>
				<div class="caption overlay-title">
					<h4 class="grid-heading">
						<?php the_title(); ?>
						<?php if ( ! empty( $categories ) ) : ?>
							<small><?php echo implode( ', ', $categories ); ?></small>
						<?php endif; ?>
					</h4>
				</div>
			</a>
		</figure>
	<?php endif; ?>
</div>