예제 #1
0
파일: config.php 프로젝트: quyip8818/wps
function kleo_sensei_title($args)
{
    $title = false;
    global $post, $wp_query;
    if (is_tax('course-category')) {
        $taxonomy_obj = $wp_query->get_queried_object();
        $taxonomy_short_name = $taxonomy_obj->taxonomy;
        $taxonomy_raw_obj = get_taxonomy($taxonomy_short_name);
        $title = sprintf(__('%1$s Archives: %2$s', 'woothemes-sensei'), $taxonomy_raw_obj->labels->name, $taxonomy_obj->name);
    }
    if (is_singular('sensei_message')) {
        $content_post_id = get_post_meta($post->ID, '_post', true);
        if ($content_post_id) {
            $title = sprintf(__('Re: %1$s', 'woothemes-sensei'), '<a href="' . get_permalink($content_post_id) . '">' . get_the_title($content_post_id) . '</a>');
        }
    }
    if (is_singular('course')) {
        remove_all_actions('sensei_course_image');
        remove_all_actions('sensei_course_single_title');
    }
    if (is_singular('lesson')) {
        remove_all_actions('sensei_lesson_image');
        remove_all_actions('sensei_lesson_single_title');
    }
    if ($title) {
        $breadcrumb_data = kleo_breadcrumb(array('show_title' => false, 'show_browse' => false, 'separator' => ' ', 'show_home' => __('Home', 'kleo_framework'), 'echo' => false));
        $breadcrumb_data = str_replace('</div>', '<span class="sep"> </span> <span class="active">' . $title . '</span> </div>', $breadcrumb_data);
        $args['output'] = str_replace('{breadcrumb_data}', $breadcrumb_data, $args['output']);
        $args['title'] = $title;
    }
    return $args;
}
예제 #2
0
/**
 * Return the breadcrumb area
 * @global object $wp_query
 * @param array $args
 * @return string
 */
function kleo_title_section($args = false)
{
    $defaults = array('title' => get_the_title(), 'show_title' => true, 'show_breadcrumb' => true, 'link' => '', 'output' => "<section class='{class} border-bottom'><div class='container'>{title_data}<div class='breadcrumb-extra'>{breadcrumb_data}{extra}</div></div></section>", 'class' => 'container-wrap main-title alternate-color ', 'extra' => '<p class="page-info">' . do_shortcode(sq_option('title_info', '')) . '</p>', 'heading' => 'h1');
    // Parse incoming $args into an array and merge it with $defaults
    $args = wp_parse_args($args, $defaults);
    $args = apply_filters('kleo_title_args', $args);
    // OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before.
    extract($args, EXTR_SKIP);
    if (!empty($link)) {
        $title = "<a href='" . $link . "' rel='bookmark' title='" . __('Permanent Link:', 'kleo_framework') . " " . esc_attr($title) . "'>" . $title . "</a>";
    }
    $breadcrumb_data = '';
    if ($show_breadcrumb) {
        $breadcrumb_data = kleo_breadcrumb(array('show_browse' => false, 'separator' => ' ', 'show_home' => __('Home', 'kleo_framework'), 'echo' => false));
    }
    $title_data = '';
    if ($show_title) {
        $title_data = '<{heading} class="page-title">{title}</{heading}>';
    }
    if (!$show_breadcrumb && $extra == '') {
        $class .= ' title-single';
    }
    $title_layout = sq_option('title_layout', 'normal');
    if (is_singular() && get_cfield('title_layout') && get_cfield('title_layout') != '') {
        $title_layout = get_cfield('title_layout');
    }
    if ($title_layout == 'center') {
        $class .= ' main-center-title';
    } elseif ($title_layout == 'right_breadcrumb') {
        $class .= ' main-right-breadcrumb';
    }
    $output = str_replace('{title_data}', $title_data, $output);
    $output = str_replace('{class}', $class, $output);
    $output = str_replace('{title}', $title, $output);
    $output = str_replace('{breadcrumb_data}', $breadcrumb_data, $output);
    $output = str_replace('{extra}', $extra, $output);
    $output = str_replace('{heading}', $heading, $output);
    return $output;
}
예제 #3
0
파일: theme-functions.php 프로젝트: 6226/wp
/**
 * Return the breadcrumb area
 * @global object $wp_query
 * @param array $args
 * @return string
 */
function kleo_title_section($args = false)
{
    $defaults = array('title' => get_the_title(), 'show_title' => true, 'show_breadcrumb' => true, 'link' => '', 'output' => "<section class='{class} border-bottom'><div class='container'>{title_data}{breadcrumb_data}{extra}</div></section>", 'class' => 'container-wrap main-title alternate-color ', 'extra' => '<p class="page-info">' . sq_option('title_info', '') . '</p>', 'heading' => 'h1');
    if (is_tax() || is_category() || is_tag()) {
        global $wp_query;
        $term = $wp_query->get_queried_object();
        if (!empty($term)) {
            $defaults['link'] = get_term_link($term);
        }
    }
    // Parse incomming $args into an array and merge it with $defaults
    $args = wp_parse_args($args, $defaults);
    $args = apply_filters('kleo_title_args', $args);
    // OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before.
    extract($args, EXTR_SKIP);
    if (!empty($link)) {
        $title = "<a href='" . $link . "' rel='bookmark' title='" . __('Permanent Link:', 'kleo_framework') . " " . esc_attr($title) . "'>" . $title . "</a>";
    }
    $breadcrumb_data = '';
    if ($show_breadcrumb) {
        $breadcrumb_data = kleo_breadcrumb(array('container_class' => 'breadcrumb'));
    }
    $title_data = '';
    if ($show_title) {
        $title_data = '<{heading} class="page-title">{title}</{heading}>';
    }
    $output = str_replace('{title_data}', $title_data, $output);
    $output = str_replace('{class}', $class, $output);
    $output = str_replace('{title}', $title, $output);
    $output = str_replace('{breadcrumb_data}', $breadcrumb_data, $output);
    $output = str_replace('{extra}', $extra, $output);
    $output = str_replace('{heading}', $heading, $output);
    return $output;
}