Esempio n. 1
0
function hitched_scripts()
{
    $js_dir = get_stylesheet_directory_uri() . '/js/src';
    $deps = ['jquery', Site::prefix('stdlib')];
    wp_register_script(Site::prefix('stdlib'), $js_dir . '/inc/stdlib.js', [], false, true);
    wp_register_script(Site::prefix('slideshow'), $js_dir . '/inc/slideshow.js', [], false, true);
    wp_register_script(Site::prefix('appointment-slider'), $js_dir . '/hitched/appointment-slider.js', [], false, true);
    wp_register_script(Site::prefix('hitched'), $js_dir . '/hitched/hitched.js', [], false, true);
    wp_register_script(Site::prefix('lightbox'), $js_dir . '/../dist/vendor/lightbox-plus-jquery.min.js', [], false, true);
    if (is_page('sample-sale')) {
        $deps[] = Site::prefix('lightbox');
    }
    if (is_front_page()) {
        $deps[] = Site::prefix('slideshow');
    }
    foreach (['appointment-slider', 'hitched'] as $name) {
        $deps[] = Site::prefix($name);
    }
    wp_localize_script(Site::prefix('hitched'), 'WP', ['HOME_URL' => get_option('home'), 'WP_URL' => get_option('siteurl'), 'AJAX_URL' => admin_url('admin-ajax.php'), 'LOADING_SPINNER_URL' => admin_url('images/loading.gif'), 'USER_ID' => wp_get_current_user()->ID]);
    wpcf7_enqueue_scripts();
    wp_enqueue_script(Site::prefix('main'), $js_dir . '/main.js', $deps, false, true);
}
Esempio n. 2
0
?>
			<article id="post-<?php 
the_ID();
?>
" <?php 
post_class(['site-width']);
?>
>
				<header>
					<h1 class="page-title screen-reader-text cursive light tc lowercase"><?php 
single_post_title();
?>
</h1>
				</header>
				<div class="entry-content tc"><?php 
the_split_content(true);
?>
</div><!-- .entry-content -->
				<?php 
set_query_var('app', \Hitched\Hitched::instance());
get_template_part("pages/{$post->post_name}");
?>
				<div class="entry-content tc"><?php 
the_split_content(false);
?>
</div><!-- .entry-content -->
			</article>
		</main><!-- .site-main -->
	</div><!-- .content-area -->
<?php 
get_footer();
Esempio n. 3
0
<?php

use Hitched\Hitched as H;
$ids = array_map(function ($img) {
    return $img->ID;
}, array_filter(get_attached_media('image'), function ($img) {
    return !empty($img->post_excerpt);
}));
$images = H::instance()->customPostsQuery($ids, ['text' => ['_wp_attachment_metadata']]);
$titles = array_map(function ($img) {
    return $img->post_title;
}, $images);
array_multisort($titles, SORT_ASC, SORT_REGULAR, $images);
?>
<h1 class="page-title cursive light tc lowercase">Gowns</h1>
<div class="designers-gallery">
	<?php 
for ($colcount = 3; $colcount > 1; $colcount--) {
    ?>
<ul class="horizontal-list tc col-<?php 
    echo $colcount;
    ?>
">
		<?php 
    foreach ($images as $i => $img) {
        $metadata = unserialize($img->_wp_attachment_metadata);
        $thumbnail = str_replace(wp_basename($metadata['file']), $metadata['sizes']['medium']['file'], $img->guid);
        ?>
		<li data-col-index="<?php 
        echo $i % $colcount;
        ?>