= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'rhyme' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'alexis_title_filter', 10, 2 ); /*-----------------------------------[ register the custom nav menu(s) ] */ register_nav_menus( array( 'primary' => __('Primary Navigation', 'alexis'), )); /*-----------------------------------[ navigation menu ] */ // display a navigation menu created in the Appearance → Menus panel function alexis_nav() { wp_nav_menu( array( 'theme_location' => 'primary', 'container' => false, 'menu_class' => 'menu', 'echo' => true, 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'depth' => '3', 'fallback_cb' => 'false', 'items_wrap' => '', 'walker' => '' )); } // remove class and ID from wp_nav_menu() for cleaner output function wp_nav_menu_attributes_filter($var) { return is_array($var) ? array_intersect($var, array('current-menu-item')) : ''; } // add_filter('nav_menu_css_class', 'wp_nav_menu_attributes_filter', 100, 1); add_filter('nav_menu_item_id', 'wp_nav_menu_attributes_filter', 100, 1); /*-----------------------------------[ switch default core markup ] */ // @link http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5 // // output valid HTML5 for search form, comment form, and comments/ // add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' )); /*-----------------------------------[ post thumbnails ] */ // enables post-thumbnail support add_theme_support( 'post-thumbnails'); /*-----------------------------------[ content width ] */ // set the content width based on the theme's design and stylesheet global $content_width; if ( ! isset( $content_width ) ) : $content_width = 730; /* pixels */ endif; /*-----------------------------------[ rss feed ] */ // enables post and comment RSS feed links to head add_theme_support( 'automatic-feed-links' ); /*-----------------------------------[ custom background ] */ $args = array( 'default-color' => 'ffffff', ); add_theme_support( 'custom-background', $args ); /*-----------------------------------------------------------------------[ WordPress comments via callback ] */ function alexis_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : // display trackbacks differently than normal comments ?>
  • id="comment-">

  • id="li-comment-">
    comment_approved ) : ?>

    %1$s %2$s', get_comment_author_link(), // if current post author is also comment author, make it known visually ( $comment->user_id === $post->post_author ) ? '' . __( 'Post author', 'alexis' ) . '' : '' ); printf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'alexis' ), get_comment_date(), get_comment_time() ) ); ?>
    __( 'Reply', 'alexis' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> ', '' ); ?>
    'Lato:300,400,700' ); wp_enqueue_style( 'google-fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null ); // required WordPress core feature if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); // loads JavaScript files wp_enqueue_script('main', get_template_directory_uri()."/js/global.js", array('jquery'),'2014-08-08',true); wp_enqueue_script('mansory', get_template_directory_uri()."/js/masonry.js", array('jquery'),'3.1.5',true); wp_enqueue_script('imagesreloaded', get_template_directory_uri()."/js/imagesloaded.js", array('jquery'),'3.1.8',true); } add_action( 'wp_enqueue_scripts', 'alexis_assets_loader' ); /*-----------------------------------[ widgets ] */ // widget setup function alexis_widget() { // call register_sidebar wp method as array register_sidebar( array( 'ID' => 'alexis-sidebar', 'name' => __( 'Primary', 'alexis' ), 'description' => __( 'Widgets will be shown on the right-hand side.', 'alexis' ), 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', )); }; add_action( 'widgets_init' , 'alexis_widget' ); /*-----------------------------------[ image caption ] */ //(if exist) add caption to featured image function the_post_thumbnail_caption() { global $post; $thumbnail_id = get_post_thumbnail_id($post->ID); $thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment')); if (!empty($thumbnail_image[0]->post_excerpt)) { echo '
    '.$thumbnail_image[0]->post_excerpt.'
    '; } else { echo ''; } } /*-----------------------------------[ image gallery ] */ // overwrite the native [gallery] shortcode, to modify the HTML layout add_filter( 'use_default_gallery_style', '__return_false' ); function alexis_gallery_shortcode( $attr = array(), $content = '' ) { $attr['itemtag'] = "li"; $attr['captiontag'] = "p"; $attr['size'] = "large"; // run the native gallery shortcode callback $html = gallery_shortcode( $attr ); // remove all tags except a, img,li, p $html = strip_tags( $html, '
  • ' ); // trivial replacements $from = array( 'class="attachment-large"', 'a href=', ); $to = array( '', 'a class="lightbox" href=', ); $html = str_replace( $from, $to, $html ); // remove width and height attributes: $html = preg_replace( '/(width|height)="\d*"\s/', "", $html ); // wrap the output in ul tags: $html = sprintf( '

    ', $html ); return $html; } add_shortcode( 'gallery', 'alexis_gallery_shortcode' ); }// end alexis_setup endif;// end ! function_exists( 'alexis_setup' ) /*-----------------------------------------------------------------------[ after setup theme init ] */ //themename custom function setup add_action( 'after_setup_theme', 'alexis_setup' );