示例#1
0
function cherry_footer_load_template()
{
    get_template_part('templates/wrapper-footer', cherry_template_base());
}
示例#2
0
/**
 * Loads template for sidebar by $name.
 *
 * @author Justin Tadlock <*****@*****.**>
 * @author Cherry Team <*****@*****.**>
 * @since  4.0.0
 * @param  string $name
 */
function cherry_get_sidebar($name = null)
{
    do_action('get_sidebar', $name);
    // Core WordPress hook.
    $name = (string) $name;
    if (false === cherry_display_sidebar($name)) {
        return;
    }
    $_name = $name . '-' . cherry_template_base();
    $templates = array();
    $templates[] = "{$_name}.php";
    $templates[] = "sidebar/{$_name}.php";
    $templates[] = "{$name}.php";
    $templates[] = "sidebar/{$name}.php";
    $templates[] = 'sidebar.php';
    $templates[] = 'sidebar/sidebar.php';
    $template_path = locate_template($templates);
    if ('' !== $template_path) {
        load_template($template_path);
        return;
    }
    // Backward compat (when template not found).
    do_action('cherry_sidebar_before', $name);
    printf('<div %s>', cherry_get_attr('sidebar', $name));
    if (is_active_sidebar("{$name}")) {
        dynamic_sidebar("{$name}");
    } else {
        do_action('cherry_sidebar_empty', $name);
    }
    echo '</div>';
    do_action('cherry_sidebar_after', $name);
}
示例#3
0
/**
 * Loads template for sidebar by $name.
 *
 * @author Justin Tadlock <*****@*****.**>
 * @author Cherry Team <*****@*****.**>
 * @since 4.0.0
 * @param string $name The name of the specialised sidebar.
 */
function cherry_get_sidebar($name = null)
{
    do_action('get_sidebar', $name);
    // Core WordPress hook.
    $name = (string) $name;
    if (false === cherry_display_sidebar($name)) {
        return;
    }
    $_name = $name . '-' . cherry_template_base();
    $templates = array();
    $templates[] = "{$_name}.php";
    $templates[] = "sidebar/{$_name}.php";
    $templates[] = "{$name}.php";
    $templates[] = "sidebar/{$name}.php";
    $templates[] = 'sidebar.php';
    $templates[] = 'sidebar/sidebar.php';
    $template_path = locate_template($templates);
    if ('' !== $template_path) {
        load_template($template_path);
        return;
    }
    /**
     * Fires before sidebar wrapper are opened.
     *
     * @since 4.0.0
     * @param string $name The name of the specialised sidebar.
     */
    do_action('cherry_sidebar_before', $name);
    printf('<div %s>', cherry_get_attr('sidebar', $name));
    if (is_active_sidebar("{$name}")) {
        dynamic_sidebar("{$name}");
    } else {
        /**
         * Fires if sidebar are empty.
         *
         * @since 4.0.0
         * @param string $name The name of the specialised sidebar.
         */
        do_action('cherry_sidebar_empty', $name);
    }
    echo '</div>';
    /**
     * Fires after sidebar wrapper are closed.
     *
     * @since 4.0.0
     * @param string $name The name of the specialised sidebar.
     */
    do_action('cherry_sidebar_after', $name);
}