'header', 'classname' => 'pagetop', 'text' => __( 'page top', 'kanagata' ), ); $parameters = array_merge( $defaults, $options ); echo '
' . '' . esc_html( $parameters['text'] ) . '
'; return; } /** * Get pagetop link * * @param array $options option is classname, text. * * @return string HTML markup */ function kanagata_pageback( $options = array() ) { $defaults = array( 'classname' => 'pageback', 'text' => __( 'page back', 'kanagata' ), ); $parameters = array_merge( $defaults, $options ); echo '
' . '' . esc_html( $parameters['text'] ) . '
'; return; } /** * Get category slags from category names * * @param string $name category name. * @param string $delimiter delimiter. */ function kanagata_catnames_to_slugs( $name, $delimiter ) { if ( ! isset( $name ) || '' === $name ) { return false; } $cat_names = explode( $delimiter, $name ); $cat_slugs = array(); foreach ( $cat_names as $cat_name ) { $cat_id = get_cat_ID( trim( $cat_name ) ); if ( 0 !== $cat_id ) { $cat = get_category( $cat_id ); array_push( $cat_slugs, $cat->slug ); } } return $cat_slugs; } /** * Set excerpt length * * @param string $length from WordPress system. * * @return number excerpt length */ function kanagata_new_excerpt_mblength( $length ) { return 1000; } add_filter( 'excerpt_mblength', 'kanagata_new_excerpt_mblength' ); /** * Set ..... on excerpt more string * * @param string $more from WordPress system. * * @return string */ function kanagata_new_excerpt_more( $more ) { if ( is_admin() ) { return $more; } return '·····'; } add_filter( 'excerpt_more', 'kanagata_new_excerpt_more' ); /* * initialization */ require_once get_template_directory() . '/inc/kanagata-init.php';