File: /var/www/iq22073873/data/www/bckln.ru/wp-content/themes/dt-the7/template-portfolio.php
<?php
/* Template Name: Portfolio */
/**
* Portfolio justified grid template
*
* @package vogue
* @since 1.0.0
*/
// File Security Check
if (!defined('ABSPATH')) {
exit;
}
global $post;
$config = Presscore_Config::get_instance();
$config->set('template', 'page');
// allow to controll page content visibility
add_action('presscore_before_main_container', 'presscore_page_content_controller', 15);
get_header();
if (presscore_is_content_visible()): ?>
<!-- Content -->
<div id="content" class="content" role="main">
<?php if (have_posts()):
while (have_posts()):
the_post(); ?>
<?php do_action('presscore_before_loop'); ?>
<div class="box-ideas">
<?php echo '<div class="box-inner">';
echo '<ul class="gallery gallery-portfolio clearfix" >';
if ($pd = get_field('gallery-photo')) {
;
foreach ($pd as $el) {
echo '<li>';
echo '<a data-fancybox="portfolio-gallery" href="' . wp_get_attachment_image_url($el['image'], 'full') . '" data-caption="' . $el['text'] . '">';
echo wp_get_attachment_image($el['image'], array(250, 200));
echo '<span class="hold-img"></span>';
echo '</a>';
echo '</li>';
}
}
?>
<?php
$my_posts = new WP_Query;
$myposts = $my_posts->query(array(
'post_type' => 'page',
'post_parent' => 14816,
'orderby' => 'date',
'order' => 'ASC'
));
foreach ($myposts as $pst) {
$a = $pst->ID;
if ($pd = get_field('gallery-photo', $a)) {
;
foreach ($pd as $el) {
echo '<li>';
echo '<a data-fancybox="portfolio"
href="' . esc_url(wp_get_attachment_image_url($el['image'], 'full')) . '"
data-caption="' . esc_attr($el['text']) . '">';
echo wp_get_attachment_image($el['image'], [250, 200], false, ['class' => 'gallery-image']);
echo '<span class="hold-img"></span>';
echo '</a>';
echo '</li>';
}
}
}
wp_reset_postdata();
echo '</ul>';
echo '</div>';
?>
</div>
<?php wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'the7mk2'), 'after' => '</div>')); ?>
<?php presscore_display_share_buttons_for_post('page'); ?>
<?php comments_template('', true); ?>
<?php endwhile; ?>
<?php else: ?>
<?php get_template_part('no-results', 'page'); ?>
<?php endif; ?>
</div><!-- #content -->
<?php
do_action('presscore_after_content');
endif; // if content visible
get_footer();