Ejemplo n.º 1
0
/**
 * Register and load JavaScript files.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function alpha_enqueue_scripts()
{
    $js_uri = trailingslashit(get_template_directory_uri()) . 'js/';
    $suffix = alpha_get_suffix();
    $version = carelib_get('public-scripts')->theme_version();
    wp_enqueue_script('alpha-general', "{$js_uri}theme{$suffix}.js", array('jquery'), $version, true);
}
Ejemplo n.º 2
0
/**
 * A custom comment callback to use with WordPress' `comments_template` function.
 *
 * @since  1.0.0
 * @access public
 * @uses   CareLib_Template_Comments::comments_callback
 * @param  object  $comment the comment object.
 * @param  array   $args list of arguments passed from wp_list_comments().
 * @param  integer $depth What level the particular comment is.
 * @return void
 */
function alpha_comments_callback($comment, $args, $depth)
{
    carelib_get('template-comments')->comments_callback($comment, $args, $depth);
}
Ejemplo n.º 3
0
/**
 * Check whether the current layout includes a sidebar.
 *
 * @since  1.0.0
 * @access public
 * @uses   CareLib_Layouts::get_theme_layout
 * @return bool true if the current layout includes a sidebar
 */
function alpha_layout_has_sidebar()
{
    return !in_array(carelib_get('layouts')->get_theme_layout(), array('1c', '1c-narrow'), true);
}
Ejemplo n.º 4
0
/**
 * Determine if we're viewing a blog section archive.
 *
 * @since  1.0.0
 * @access public
 * @uses   CareLib_Template_Archive::is_blog_archive
 * @return bool true if we're on a blog archive page.
 */
function alpha_is_blog_archive()
{
    return carelib_get('template-archive')->is_blog_archive();
}
Ejemplo n.º 5
0
/**
 * Set up theme defaults and add support for WordPress and CareLib features.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function alpha_setup()
{
    carelib_get('layouts')->set_default(is_rtl() ? '2c-l' : '2c-r')->add_support();
    carelib_get('site-logo')->add_support();
    add_theme_support('automatic-feed-links');
}
Ejemplo n.º 6
0
/**
 * Output a next and previous post navigation element on single entries.
 *
 * @since  1.0.0
 * @access public
 * @uses   CareLib_Template_Entry::get_post_navigation
 * @param  array $args A list of arguments to be merged with defaults.
 * @return void
 */
function alpha_post_navigation($args = array())
{
    echo carelib_get('template-entry')->get_post_navigation($args);
}
Ejemplo n.º 7
0
/**
 * Display the theme's footer credit links.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function alpha_footer_content()
{
    printf('<p class="credit">%s</p>', sprintf(__('Copyright &#169; %1$s %2$s. Designed by %3$s.', 'alpha'), date_i18n('Y'), carelib_get('template-global')->get_site_link(), carelib_get('template-global')->get_credit_link()));
}
Ejemplo n.º 8
0
/**
 * Return an HTML element's attributes.
 *
 * @since  1.0.0
 * @access public
 * @param  string $slug the slug/ID of the element (e.g., 'sidebar').
 * @param  string $context a specific context (e.g., 'primary').
 * @param  array  $attr A list of attributes to be merged.
 * @return string the attributes for a given element
 */
function alpha_get_attr($slug, $context = '', $attr = array())
{
    return carelib_get('attributes')->get_attr($slug, $context, $attr);
}
Ejemplo n.º 9
0
/**
 * Registers sidebars.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function alpha_register_sidebars()
{
    carelib_get('sidebar')->register(array('id' => 'primary', 'name' => _x('Primary Sidebar', 'sidebar', 'alpha'), 'description' => __('The main sidebar. It is displayed on either the left or right side of the page based on the chosen layout.', 'alpha')));
    carelib_get('sidebar')->register(array('id' => 'footer-widgets', 'name' => _x('Footer Widgets', 'sidebar', 'alpha'), 'description' => __('A widgeted area which displays just before the main site footer on all pages.', 'alpha')));
}
Ejemplo n.º 10
0
/**
 * Helper function to build a newer/older or paginated navigation element within
 * a loop of multiple entries.
 *
 * @since  1.0.0
 * @access public
 * @uses   CareLib_Template_Archive::get_posts_navigation
 * @param  array $args A list of arguments to be merged with defaults.
 * @return void
 */
function alpha_posts_navigation($args = array())
{
    echo carelib_get('template-archive')->get_posts_navigation($args);
}
Ejemplo n.º 11
0
/**
 * Return a formatted link to the customizer panel.
 *
 * @since  1.0.0
 * @access public
 * @uses   CareLib_Template_Global::get_customizer_link
 * @param  array $args options for how the link will be formatted.
 * @return string an escaped link to the WordPress customizer panel.
 */
function alpha_get_customizer_link($args = array())
{
    return carelib_get('template-global')->get_customizer_link($args);
}