classes as $key => $value) { $menu_class .= ' ' . $value; } if (in_array('menu-item-has-children', $item->classes)) { // parent $input_id = "nav-".$item->ID; $caption = $item->title; $label = ''; if($args->theme_location === 'primary'){ $label = "\n" .'' . "\n" ; } $output .= "\n" . ''; } else { // child $output .= "\n".'' ."\n" ; } } private function create_a_tag($item, $depth, $args , $label) { // link attributes $attributes = ' class="menu_s_a f_box ai_c"'; $attributes .= ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : ''; $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : ''; $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : ''; $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : ''; //$attributes .= ' class="menu-link ' . ( $depth > 0 ? 'sub-menu-link' : 'main-menu-link' ) . '"'; $item_output = sprintf( '%1$s%3$s%4$s%5$s%6$s%7$s', $args->before, $attributes, $args->link_before, apply_filters( 'the_title', $item->title, $item->ID ), $args->link_after, $label, $args->after ); return apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); } } if ( ! function_exists( 'simple_days_site_title_text' ) ) : /** * Displays the site title in the header area */ function simple_days_site_title_text() { $site_title_effects = ''; if((get_theme_mod( 'simple_days_font_site_title_google_jp', 'none' ) !== 'none' || get_theme_mod( 'simple_days_font_body_google_jp', 'none' ) !== 'none' || get_theme_mod( 'simple_days_font_headings_google_jp', 'none' ) !== 'none') && get_theme_mod( 'simple_days_font_site_title_google_jp_effects_1', 'none' ) !== 'none'){ $site_title_effects = ' font-effect-'.get_theme_mod( 'simple_days_font_site_title_google_jp_effects_1'); }elseif((get_theme_mod( 'simple_days_font_site_title_google', 'none' ) !== 'none' || get_theme_mod( 'simple_days_font_body_google', 'none' ) !== 'none' || get_theme_mod( 'simple_days_font_headings_google', 'none' ) !== 'none') && get_theme_mod( 'simple_days_font_site_title_google_effects_1', 'none' ) !== 'none'){ $site_title_effects = ' font-effect-'.get_theme_mod( 'simple_days_font_site_title_google_effects_1'); } echo '

'.get_bloginfo( 'name' ).'

'; } endif; if ( ! function_exists( 'simple_days_tag_line' ) ) : /** * Displays the tag line in the header area */ function simple_days_tag_line() { echo '
'.get_bloginfo('description').'
'; } endif; if ( ! function_exists( 'simple_days_sub_menu' ) ) : /** * Displays the sub menu in the header area */ function simple_days_sub_menu() { ?> '; } endif; if ( ! function_exists( 'simple_days_get_logo' ) ) : function simple_days_get_logo() { if ( has_custom_logo() ){ $logo = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' ); }else{ $logo[0] = SIMPLE_DAYS_THEME_URI .'assets/images/logo.png'; $logo[1] = '1280'; $logo[1] = '960'; } return $logo; } endif; if ( ! function_exists( 'simple_days_menu_box' ) ) : function simple_days_menu_box() { if ( has_nav_menu('primary')) { echo ''; } } endif; if ( ! function_exists( 'simple_days_search_box' ) ) : function simple_days_search_box() { if(is_active_sidebar( 'search_widget' )){ echo ''; } } endif; if ( ! function_exists( 'simple_days_primary_menu' ) ) : function simple_days_primary_menu() {?>
'; $icon_image = get_theme_mod( 'simple_days_header_icon',''); if( '' !== $icon_image){ $icon_image_width = get_theme_mod( 'simple_days_icon_image_width',32); $icon_image_height = get_theme_mod( 'simple_days_icon_image_height',32); echo ''. esc_attr( get_bloginfo( 'name', 'display' ) ) .''; echo ''; } if ( has_custom_logo() ) { $image = simple_days_get_logo(); echo '

'; }else{ simple_days_site_title_text(); } echo ''; if($mod == "bottom" || $mod == "right") simple_days_tag_line(); } endif; if ( ! function_exists( 'simple_days_get_thumbnail' ) ) : function simple_days_get_thumbnail($post_id , $size , $post_data) { /* * @param string $post_id Post ID. * @param string $size thumbnail, middle ,large etc. * @param string $post_data $post. */ $thumbnail = array(); if(has_post_thumbnail($post_id)) { $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post_id) , $size ); $thumbnail['has_image'] = true; return $thumbnail; }elseif(isset($post_data->post_content)){ $thumbnail[1] = 640; $thumbnail[2] = 480; preg_match_all("/]+src=[\"'](s?https?:\/\/[\-_\.!~\*'()a-z0-9;\/\?:@&=\+\$,%#]+\.(jpg|jpeg|png|gif))[\"'][^>]+>/i", $post_data->post_content, $thumurl); if(isset($thumurl [1] [0])){ $thumbnail[0] = $thumurl[1][0]; $thumbnail['has_image'] = true; return $thumbnail; } $thumbnail[0] = get_theme_mod( 'simple_days_no_img' , SIMPLE_DAYS_THEME_URI .'assets/images/no_image.png'); $thumbnail['has_image'] = false; return $thumbnail; }else{ $thumbnail[0] = get_theme_mod( 'simple_days_ogp_logo_img', SIMPLE_DAYS_THEME_URI .'assets/images/ogp.jpg'); $thumbnail['has_image'] = true; return $thumbnail; } } endif; if ( ! function_exists( 'simple_days_document_title_separator' ) ) : function simple_days_document_title_separator( $separator ) { return esc_html( ' '.get_theme_mod( 'simple_days_title_separator','|').' ' ); } endif; add_filter( 'document_title_separator', 'simple_days_document_title_separator' ); if ( ! function_exists( 'simple_days_remove_hentry' ) ) : function simple_days_remove_hentry( $hentry ) { return array_diff($hentry, array('hentry')); } endif; add_filter('post_class', 'simple_days_remove_hentry'); if ( ! function_exists( 'simple_days_comment_author_anchor' ) ) : function simple_days_comment_author_anchor( $author_link ){ return str_replace( "