예제 #1
0
/**
 * Remove custom-background class from the array of body classes.
 */
function aperture_remove_body_class($classes)
{
    // Remove the custom background when the page slider is displayed.
    if (is_page_template('template-parts/page-slider.php') && aperture_has_featured_posts(2)) {
        foreach ($classes as $key => $value) {
            if ($value == 'custom-background') {
                unset($classes[$key]);
            }
        }
    }
    return $classes;
}
예제 #2
0
/**
 * Enqueue scripts and styles.
 */
function aperture_scripts()
{
    // Add custom fonts, used in the main stylesheet.
    wp_enqueue_style('aperture-fonts', aperture_fonts_url(), array(), null);
    // Add Genericons, used in the main stylesheet.
    wp_enqueue_style('genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.3.1');
    // Load the theme main stylesheet.
    wp_enqueue_style('aperture-style', get_stylesheet_uri());
    // Load the theme custom script file.
    wp_enqueue_script('aperture-script', get_template_directory_uri() . '/js/aperture.js', array('jquery'), '20150720', true);
    wp_enqueue_script('aperture-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true);
    wp_enqueue_script('aperture-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true);
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    // Only load the Flexslider script file on slider pages and when there are more than two featured posts.
    if (is_page_template('template-parts/page-slider.php') && aperture_has_featured_posts(2)) {
        wp_enqueue_script('aperture-slider-script', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'));
    }
    // Pass data from the customizer to the theme script file on slider pages.
    if (is_page_template('template-parts/page-slider.php') && aperture_has_featured_posts(2)) {
        wp_localize_script('aperture-script', 'apertureSlider', array('aperture_animation' => get_theme_mod('aperture_slider_animation', 'slide'), 'aperture_direction' => get_theme_mod('aperture_slider_direction', 'horizontal'), 'aperture_slideshow' => get_theme_mod('aperture_slider_slideshow', 'true'), 'aperture_sliderspeed' => get_theme_mod('aperture_slider_speed', '7000')));
    }
}
예제 #3
0
            echo esc_attr(sprintf(__('Permalink to %s', 'aperture'), the_title_attribute('echo=0')));
            ?>
" rel="bookmark">Read more...</a></div>
									</div><!-- #post-## -->
								</div><!-- .featured-hentry-wrap -->
							</li>
				<?php 
        }
    }
    wp_reset_postdata();
    ?>
			</ul><!-- .featured-posts -->
		</div><!-- #featured-content -->

	<?php 
} elseif (aperture_has_featured_posts(1)) {
    ?>

		<div id="featured-content" class="flexslider single-featured-post">
			<ul class="featured-posts slides">

				<?php 
    foreach ($featured as $post) {
        setup_postdata($post);
        if (has_post_thumbnail()) {
            ?>

						<?php 
            $post_thumbnail_id = get_post_thumbnail_id();
            $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id);
            ?>