@' . $usr . '' ); } } /** * Echo a Pagination tag. */ function bone_Pagination() { if ( is_single() && ( get_previous_post_link() || get_next_post_link() ) ) { echo '
'; } elseif ( get_previous_posts_link() || get_next_posts_link() ) { echo '
'; } } /** * Echo a style tag for full screen background. * This toggled by customizer option. * * @since Bone 1.0 */ function bone_opt_full_screen_bg() { if ( get_option( 'bg_cover' )['check01'] ) { $css = 'body.custom-background{background-size: cover; background-position: center;}'; wp_add_inline_style( 'bone-main-style', $css ); } } add_action( 'wp_enqueue_scripts', 'bone_opt_full_screen_bg' ); /** * Echo a class for fixed header and side navigation. * This toggled by customizer option. * * @since Bone 1.0 */ function bone_opt_fix_layout() { $result = ""; if ( get_option( 'header_fix' )['check01'] || !isset( get_option( 'header_fix' )['check01'] ) ) { $result .= " mdl-layout--fixed-header"; } if ( get_option( 'side_fix' )['check01'] ) { $result .= " mdl-layout--fixed-drawer"; } echo $result; } /** * Echo a class for scroll content. * This toggled by customizer option. * * @since Bone 1.0 */ function bone_opt_scroll_content() { if ( !get_option( 'header_fix' )['check01'] ) { echo " mdl-layout__header--scroll "; } } /** * Echo a class for column number. * This changed by customizer option. * * @since Bone 1.0 */ function bone_opt_column_number() { if ( isset( get_option( 'column' )['select01'] ) ) { return 12 / get_option( 'column' )['select01']; } else { return 4; } } /** * Echo a class for transparent header. * This toggled by customizer option. * * @since Bone 1.0 */ function bone_opt_transparent_header() { if ( get_option( 'header_transparent' )['check01'] ) { echo ' mdl-layout__header--transparent '; } } /** * Echo a class for adjust grid space. * This changed by customizer option. * * @since Bone 1.0 */ function bone_opt_space_content() { $class = get_option( 'grid-space' )['radio']; if ( !$class ) { $class = 'midium'; } echo 'bone-grid-space-'.$class; } /** * Echo a link(rel="stylesheet") for material design lite framework. * This changed by customizer option. * * @link http://www.getmdl.io/components/ * @since Bone 1.0 */ function bone_opt_mdl_stylesheet() { $main = get_option( 'color_set' )['main']; $sub = get_option( 'color_set' )['sub']; echo "https://storage.googleapis.com/code.getmdl.io/1.0.4/material.${main}-${sub}.min.css"; } /** * Echo a SNS icons to the footer. * This changed by customizer option. * * @since Bone 1.0 */ function bone_opt_sns_icons() { $sns = ['twitter', 'facebook', 'google-plus', 'instagram', 'youtube']; foreach ( $sns as $name ) { if ( get_option( $name )[ 'text' ] ) { echo ''; } } } /** * Set a logo image. * * @since Bone 1.0 */ function bone_opt_logo() { $img = get_option( 'logo' )['img']; if ( $img ) { $css = <<< CSS .bone-drawer__title { background-image: url( {$img} ); background-repeat: no-repeat; background-size: cover; background-position: center; } CSS; wp_add_inline_style( 'bone-main-style', $css ); } } add_action( 'wp_enqueue_scripts', 'bone_opt_logo' ); /** * Echo a tag about post date. * * @since Bone 1.0 */ function bone_time_stamp() { $entry = get_post_modified_time(); $today = time(); $diff = date( 'U', ( $today - $entry ) ) / 86400; if ( $diff < 7 ) { echo __( 'Last Updated ', 'bone' ) . human_time_diff( $entry, current_time('timestamp') ) . __( ' ago', 'bone' ); } else { echo the_time(); } } /** * Echo the tag about breadcrumb * * @since Bone 1.0 */ function bone_crumb( $name, $href=false ) { if ($href) { $name = '' . $name . ''; } echo '
  • ' . $name . '
  • '; }