for posts and comments. add_theme_support( 'automatic-feed-links' ); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Primary Menu', 'almanac' ) ); /* * This theme supports custom background color and image, and here * we also set up the default background color. */ add_theme_support( 'custom-background', array( 'default-color' => 'f3f0ed', ) ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); add_image_size('mainthumb', 400, 200, true); } add_action( 'after_setup_theme', 'almanac_setup' ); /** * Enqueues scripts and styles for front-end. * * @since Twenty Twelve 1.0 */ function almanac_scripts_styles() { global $wp_styles; /* * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); /* * Adds JavaScript for handling the navigation menu hide-and-show behavior. */ wp_enqueue_script('jquery'); wp_enqueue_script( 'superfish-script', get_template_directory_uri() . '/js/superfish.js'); wp_enqueue_script( 'fancybox-script', get_template_directory_uri() . '/js/fancybox.js'); wp_enqueue_script( 'mobilemenu-script', get_template_directory_uri() . '/js/mobilemenu.js'); wp_enqueue_script( 'almanac-script', get_template_directory_uri() . '/js/almanacscripts.js'); /* * Loads our main stylesheet. */ wp_enqueue_style( 'almanac-style', get_stylesheet_uri()); } add_action( 'wp_enqueue_scripts', 'almanac_scripts_styles' ); /** * Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link. * */ function almanac_page_menu_args( $args ) { if ( ! isset( $args['show_home'] ) ) $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'almanac_page_menu_args' ); /** * Registers our main widget area and the front page widget areas. * */ function almanac_widgets_init() { register_sidebar( array( 'name' => __( 'Left Sidebar', 'almanac' ), 'id' => 'sidebar-1', 'description' => __( 'Appears in all posts and pages when not using the full width page template', 'almanac' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Top Widget', 'almanac'), 'id' => 'sidebar-2', 'description' => __( 'Appears on the top of the website in every page', 'almanac' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'almanac_widgets_init' ); if ( ! function_exists( 'almanac_content_nav' ) ) : /** * Displays navigation to next/previous pages when applicable. * */ function almanac_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' : // Display trackbacks differently than normal comments. ?>
  • id="comment-">

    ', '' ); ?>

  • id="li-comment-">
    %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', 'almanac') . '' : '' ); printf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'almanac'), get_comment_date(), get_comment_time() ) ); ?>
    comment_approved ) : ?>

    ', '

    ' ); ?>
    __( 'Reply', 'almanac'), 'after' => ' ', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    = 2 || $page >= 2 ) $title .= " {$sep} " . sprintf( __( 'Page %s', 'dbt' ), max( $paged, $page ) ); return $title; } if ( ! function_exists( 'almanac_pagination' ) ) : function almanac_pagination() { global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages ) ); } endif;