Ejemplo n.º 1
0
/**
 * Registers and loads the theme's scripts.
 *
 * @since  0.1.0
 * @access public
 * @return void
 */
function unique_enqueue_scripts()
{
    /* Enqueue the 'flexslider' script. */
    if (is_page_template('page/page-template-magazine.php')) {
        wp_enqueue_script('flexslider', hybrid_locate_theme_file('js/flexslider/flexslider.min.js'), array('jquery'), '20120713', true);
    }
    /* Enqueue the Unique theme script. */
    wp_enqueue_script('unique-theme', hybrid_locate_theme_file('js/unique.js'), array('jquery'), '20130910', true);
}
Ejemplo n.º 2
0
/**
 * Searches for a locale stylesheet.  This function looks for stylesheets in the `css` folder in the following 
 * order:  1) $lang-$region.css, 2) $region.css, 3) $lang.css, and 4) $text_direction.css.  It first checks 
 * the child theme for these files.  If they are not present, it will check the parent theme.  This is much 
 * more robust than the WordPress locale stylesheet, allowing for multiple variations and a more flexible 
 * hierarchy.
 *
 * @since  2.0.0
 * @access public
 * @return string
 */
function hybrid_get_locale_style()
{
    $locale = strtolower(str_replace('_', '-', get_locale()));
    $lang = strtolower(hybrid_get_language());
    $region = strtolower(hybrid_get_region());
    $styles = array();
    $styles[] = "css/{$locale}.css";
    if ($region !== $locale) {
        $styles[] = "css/{$region}.css";
    }
    if ($lang !== $locale) {
        $styles[] = "css/{$lang}.css";
    }
    $styles[] = is_rtl() ? 'css/rtl.css' : 'css/ltr.css';
    return hybrid_locate_theme_file($styles);
}
Ejemplo n.º 3
0
		<ul class="loop-entries-gallery">

			<?php 
    while (have_posts()) {
        // Begins the loop through found posts.
        ?>

				<?php 
        the_post();
        // Loads the post data.
        ?>

				<li>
					<?php 
        get_the_image(array('default' => hybrid_locate_theme_file(array('images/placeholder-540.png')), 'size' => 'ravel-medium', 'scan' => true, 'order' => array('scan', 'featured', 'attachment', 'default'), 'before' => '<figure>', 'after' => '</figure>'));
        ?>
					<?php 
        the_title('<h2 ' . hybrid_get_attr('entry-title') . '><a href="' . get_permalink() . '" rel="bookmark" itemprop="url">', '</a></h2>');
        ?>
				</li>

			<?php 
    }
    // End found posts loop.
    ?>

		</ul>

		<?php 
    locate_template(array('misc/loop-nav.php'), true);
Ejemplo n.º 4
0
/**
 * Loads scripts needed by the theme.
 *
 * @since  0.1.0
 * @access public
 * @return void
 */
function socially_awkward_enqueue_scripts()
{
    wp_enqueue_script('socially-awkward', hybrid_locate_theme_file(array('js/socially-awkward.js')), array('jquery'), '20130812', true);
}
Ejemplo n.º 5
0
/**
 * Filters the 'stylesheet_uri' and checks if a post has a style that should overwrite the theme's
 * primary `style.css`.
 *
 * @since  3.0.0
 * @access public
 * @param  string  $stylesheet_uri
 * @return string
 */
function hybrid_style_filter($stylesheet_uri)
{
    if (is_singular()) {
        $style = hybrid_get_post_style(get_queried_object_id());
        if ($style && ($style_uri = hybrid_locate_theme_file(array($style)))) {
            $stylesheet_uri = $style_uri;
        }
    }
    return $stylesheet_uri;
}