/** * short helper to add [svg icon="{x}"] to our editor * @param Array $args * @return String output */ function cora_the_shortcode_svg($args) { $output = cora_get_icon($args['icon']); if (isset($args['bubble']) && $args['bubble']) { $output = '<span class="bubble">' . $output . '</span>'; } return $output; }
/** * callback to generate custom start elements * * @since 0.1 * @created 10.01.2014, cb * @updated 10.01.2014, cb * * @param String $output * @param WP_Post $item * @param Integer $depth * @param Array $args * @param Integer $current_object_id * * @return Void */ function start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0) { $nav_item_class = $args->menu . '-navigation-item'; $sanitized_title = sanitize_title($item->title); // passed classes $classes = empty($item->classes) ? array() : (array) $item->classes; $classes[] = $nav_item_class; $classes[] = $sanitized_title . '-navigation-item'; $classes = apply_filters('nav_menu_css_class', array_filter($classes), $item); $classes = implode(' ', $classes); $classes = esc_attr($classes); // build html $output .= '<li class="' . $classes . '">'; // link attributes $attributes = array(); if (!empty($item->attr_title) && $item->attr_title !== $item->title) { $attributes['title'] = esc_attr($item->attr_title); } if (!empty($item->url)) { $attributes['href'] = esc_url($item->url); } else { $attributes['href'] = esc_url(get_permalink($item->ID)); } $attr = ''; foreach ($attributes as $key => $value) { $attr = $key . '="' . $value . '"'; } $item_output = $args->before; $item_output .= '<a ' . $attr . '>'; $item_output .= $args->link_before; $item_output .= cora_get_icon($sanitized_title); $item_output .= '<span class="' . $nav_item_class . '-title">' . apply_filters('the_title', $item->title, $item->ID) . '</span>'; $item_output .= $args->link_after; $item_output .= '</a>'; $item_output .= $args->after; // build html $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args); }
/** * Post meta data * * @package Cora-2014 * @subpackage Templateparts */ if (is_page()) { return; } ?> <p class="post-meta"> <?php // Translators: used between list items, there is a space after the comma. $icon_args = array('title' => __('Kategorien', 'cora-2014')); $categories_list = cora_get_icon('tag', $icon_args); $categories_list .= ' ' . get_the_category_list(__(', ', 'cora-2014')); $date = sprintf('| <time class="post-date" datetime="%1$s">%2$s</time>', esc_attr(get_the_date('c')), esc_html(get_the_date())); // comments $comment_number = get_comments_number(); if ($comment_number > 0) { $comment_text = '| <a href="' . get_comments_link() . '" title="' . __('Das denkt Ihr über diesen Beitrag', 'cora-2014') . '">'; $comment_text .= $comment_number . ' '; $comment_text .= ' <span class="screen-reader-text">'; $comment_text .= _n('Meinung', 'Meinungen', $comment_number, 'cora-2014'); $comment_text .= '</a>'; } else { $comment_text = ''; } // Translators: 1 is category, 2 is the date and 3 is the author's name, 4 is the comment link printf(__('%1$s %2$s %3$s', 'cora-2014'), $categories_list, $date, $comment_text);
?> " title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?> " rel="home"> <span class="site-header-title"><?php bloginfo('name'); ?> </span> <span class="site-ueber-mich"><?php echo cora_get_icon('ueber-mich'); ?> </span> <div class="site-header-description"><span><?php bloginfo('description'); ?> </span></div> </a> </header> <?php get_template_part('parts/navigation', 'header'); ?> <main id="site-content" role="main"> <div id="site-content-inner" class="clearfix"> <?php if (function_exists('yoast_breadcrumb') && !is_front_page()) { yoast_breadcrumb('<nav id="site-breadcrumb">' . cora_get_icon('tag') . ' ', '</nav>'); }
</a> </div> </header> <?php // the posts of this category get_template_part('parts/loop', ''); ?> </div> </div> <nav class="sly-nav"> <button title="<?php _e('vorheriger', 'cora-2014'); ?> " class="sly-nav-button sly-nav-lt"><?php echo cora_get_icon('lt'); ?> </button> <button title="<?php _e('nächster', 'cora-2014'); ?> " class="sly-nav-button sly-nav-gt"><?php echo cora_get_icon('gt'); ?> </button> </nav> </section> <?php } } wp_reset_query();