for posts and comments. add_theme_support( 'automatic-feed-links' ); // This theme supports custom background color and image. $defaults = array( 'default-color' => '', 'default-image' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $defaults ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 810, 9999 ); // This theme uses a custom header background image. $args = array( 'width' => 810, 'flex-height' => true, 'default-image' => get_template_directory_uri() . '/images/header.jpg', 'header-text' => false, 'random-default' => true,); add_theme_support( 'custom-header', $args ); } add_action( 'after_setup_theme', 'leatherdiary_setup' ); /** * Enqueues scripts and styles for front-end. * */ function leatherdiary_scripts_styles() { global $wp_styles; // Adds JavaScript if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'placeholders', get_template_directory_uri() . '/js/placeholders.js', array(), '2.1.0', true ); wp_enqueue_script( 'scroll-to-top', get_template_directory_uri() . '/js/scroll-to-top.js', array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'scrolltop', get_template_directory_uri() . '/js/scrolltop.js', array(), '1.0', true ); wp_enqueue_script( 'selectnav', get_template_directory_uri() . '/js/selectnav.js', array(), '0.1', true ); wp_enqueue_script( 'responzive', get_template_directory_uri() . '/js/responzive.js', array(), '1.0', true ); // Loads the main stylesheet. wp_enqueue_style( 'leatherdiary-style', get_stylesheet_uri() ); wp_enqueue_style( 'google-font-default', 'http://fonts.googleapis.com/css?family=Dancing+Script' ); } add_action( 'wp_enqueue_scripts', 'leatherdiary_scripts_styles' ); /** * Sets up the content width value based on the theme's design and stylesheet. * */ if ( ! isset( $content_width ) ) $content_width = 810; /** * Creates a nicely formatted and more specific title element text. * */ function leatherdiary_wp_title( $title, $sep ) { if ( is_feed() ) return $title; $title .= get_bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; return $title; } add_filter( 'wp_title', 'leatherdiary_wp_title', 10, 2 ); /** * Register our menus. * */ function leatherdiary_register_my_menus() { register_nav_menus( array( 'fixed-navigation' => __( 'Fixed Menu', 'leatherdiary' ), 'top-navigation' => __( 'Top Header Menu', 'leatherdiary' ) ) ); } add_action( 'after_setup_theme', 'leatherdiary_register_my_menus' ); /** * Register our sidebars and widgetized areas. * */ function leatherdiary_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'leatherdiary' ), 'id' => 'sidebar-1', 'description' => __( 'Right sidebar which appears on all posts and pages.', 'leatherdiary' ), 'before_widget' => '', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer left widget area', 'leatherdiary' ), 'id' => 'sidebar-2', 'description' => __( 'Left column with widgets in footer.', 'leatherdiary' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => __( 'Footer middle widget area', 'leatherdiary' ), 'id' => 'sidebar-3', 'description' => __( 'Middle column with widgets in footer.', 'leatherdiary' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => __( 'Footer right widget area', 'leatherdiary' ), 'id' => 'sidebar-4', 'description' => __( 'Right column with widgets in footer.', 'leatherdiary' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => __( 'Footer notices', 'leatherdiary' ), 'id' => 'sidebar-5', 'description' => __( 'The line for copyright and other notices below the footer widget areas. Insert here one Text widget. The "Title" field at this widget should stay empty.', 'leatherdiary' ), 'before_widget' => '', 'before_title' => '', 'after_title' => '', ) ); register_sidebar( array( 'name' => __( 'Homepage posts', 'leatherdiary' ), 'id' => 'sidebar-7', 'description' => __( 'The area for any LeatherDiary Homepage Widgets, which display latest posts from a specific category.', 'leatherdiary' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ) ); } add_action( 'widgets_init', 'leatherdiary_widgets_init' ); if ( ! function_exists( 'leatherdiary_content_nav' ) ) : /** * Displays navigation to next/previous pages when applicable. * */ function leatherdiary_content_nav( $html_id ) { global $wp_query; $html_id = esc_attr( $html_id ); if ( $wp_query->max_num_pages > 1 ) : ?> comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="comment-">

    ', '' ); ?>

  • id="li-comment-">
    %1$s %2$s', get_comment_author_link(), ( $comment->user_id === $post->post_author ) ? '' . __( '(Post author)', 'leatherdiary' ) . '' : '' ); printf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), // translators: 1: date, 2: time sprintf( __( '%1$s at %2$s', 'leatherdiary' ), get_comment_date(''), get_comment_time() ) ); ?>
    comment_approved ) : ?>

    __( 'Reply', 'leatherdiary' ), 'after' => ' ', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ', '

    ' ); ?>
    $object ) { if ( 0 == $object->menu_item_parent ) { $top_ids[$i] = $object; continue; } if ( ! in_array( $object->menu_item_parent, $ids ) ) { $objects[$i]->classes[] = 'first-menu-item'; $ids[] = $object->menu_item_parent; } if ( in_array( 'first-menu-item', $object->classes ) ) continue; $parent_ids[$i] = $object->menu_item_parent; } $sanitized_parent_ids = array_unique( array_reverse( $parent_ids, true ) ); foreach ( $sanitized_parent_ids as $i => $id ) $objects[$i]->classes[] = 'last-menu-item'; return $objects; } /** * Include the TGM_Plugin_Activation class. * */ require_once get_template_directory() . '/class-tgm-plugin-activation.php'; add_action( 'tgmpa_register', 'leatherdiary_my_theme_register_required_plugins' ); function leatherdiary_my_theme_register_required_plugins() { $plugins = array( array( 'name' => 'Breadcrumb NavXT', 'slug' => 'breadcrumb-navxt', 'source' => get_template_directory_uri() . '/plugins/breadcrumb-navxt.zip', 'required' => false, ), ); $config = array( 'domain' => 'leatherdiary', 'menu' => 'install-my-theme-plugins', 'strings' => array( 'page_title' => __( 'Install Required Plugins', 'leatherdiary' ), 'menu_title' => __( 'Install Plugins', 'leatherdiary' ), 'instructions_install' => __( 'The %1$s plugin is required for this theme. Click on the big blue button below to install and activate %1$s.', 'leatherdiary' ), 'instructions_activate' => __( 'The %1$s is installed but currently inactive. Please go to the plugin administration page page to activate it.', 'leatherdiary' ), 'button' => __( 'Install %s Now', 'leatherdiary' ), 'installing' => __( 'Installing Plugin: %s', 'leatherdiary' ), 'oops' => __( 'Something went wrong with the plugin API.', 'leatherdiary' ), // */ 'notice_can_install' => __( 'This theme requires the %1$s plugin. Click here to begin the installation process. You may be asked for FTP credentials based on your server setup.', 'leatherdiary' ), 'notice_cannot_install' => __( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'leatherdiary' ), 'notice_can_activate' => __( 'This theme requires the %1$s plugin. That plugin is currently inactive, so please go to the plugin administration page to activate it.', 'leatherdiary' ), 'notice_cannot_activate' => __( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'leatherdiary' ), 'return' => __( 'Return to Required Plugins Installer', 'leatherdiary' ), ), ); tgmpa( $plugins, $config ); } /** * Custom Shortcodes. * */ function leatherdiary_button_shortcode($atts, $content = null) { extract(shortcode_atts(array('link' => '#'), $atts)); return '' . do_shortcode($content) . ''; } add_shortcode( 'button', 'leatherdiary_button_shortcode' ); add_filter('widget_text', 'do_shortcode'); function leatherdiary_highlight_shortcode($atts, $content = null) { return '' . do_shortcode($content) . ''; } add_shortcode( 'highlight', 'leatherdiary_highlight_shortcode' ); function leatherdiary_image_shortcode($atts, $content = null){ return ''; } add_shortcode('image','leatherdiary_image_shortcode'); ?>