HEX
Server: Apache/2.4.37 (AlmaLinux) mpm-itk/2.4.7-04 OpenSSL/1.1.1k PHP/7.2.24
System: Linux cp.iqhost.ru 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User: iq22073873 (6195)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /var/www/iq22073873/data/www/bckln.ru/wp-content/themes/dt-the7/template-ideas.php
<?php
/* Template Name: Ideas */

/**
 * Media Albums template. Uses dt_gallery post type and dt_gallery_category taxonomy.
 *
 * @package presscore
 * @since presscore 0.1
 */

// File Security Check
// File Security Check
if (!defined('ABSPATH')) {
	exit;
}

$config = Presscore_Config::get_instance();
$config->set('template', 'page');

get_header(); ?>

<?php if (presscore_is_content_visible()): ?>

	<div id="content" class="content" role="main">

		<?php if (have_posts()):
			while (have_posts()):
				the_post(); ?>

				<?php do_action('presscore_before_loop'); ?>

				<?php the_content(); ?>

				<?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'); ?>

<?php endif; // if content visible ?>
</div>
</div>
<div class="box-ideas <?php if (get_the_ID() == 14816) {
	echo 'red-box';
} ?>">
	<?php $postchild = get_the_ID();
	$my_posts = new WP_Query;
	$myposts = $my_posts->query(array(
		'post_type' => 'page',
		'post_parent' => $postchild,
		'orderby' => 'date',
		'order' => 'ASC'
	));

	foreach ($myposts as $pst) {
		$bg = '';
		$a = $pst->ID;
		$colorbox = get_field('color-box', $a);
		$bgbox = get_field('bg-box', $a);
		if ($bgbox || $colorbox) {
			$bg = 'background:#' . $colorbox . ' url(' . wp_get_attachment_url($bgbox) . ') no-repeat';
		}
		echo '<div class="hold-idea" style="' . $bg . '">';
		echo '<div class="wrap">';
		echo '<div class="box-inner">';
		echo '<strong class="title"><a href="' . $pst->guid . '">' . $pst->post_title . '</a></strong>';
		echo '</div>';
		echo '<div class="box-inner">';
		if ($pd = get_field('gallery-photo', $a)) {
			echo '<ul class="gallery gallery-catefory clearfix">';
			foreach ($pd as $el) {
				echo '<li>';
				echo '<a data-fancybox="gallery-' . $a . '" 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>';
			}
			echo '</ul>';
		}
		echo '</div>';

		echo '</div>';
		echo '</div>';
	}
	wp_reset_postdata();
	?>

</div>
<div>
	<div>
		<?php get_footer(); ?>