__( 'Primary Menu', 'custom' ) ) ); // Post Formats add_theme_support( 'post-formats', array( 'video', 'image' ) ); // Adds Custom Background support in admin panel $args = array( 'default-color' => 'CCCCCC' ); add_theme_support( 'custom-background', $args ); /* ============================================================ Adds Post Thumbnail feature in admin panels =============================================================*/ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size(75, 75, true); add_image_size('index-thumb', 620, 9999); add_image_size('single-thumb', 620, 9999); add_image_size('feature-slider', 930, 400, true); // Add custom image sizes (optional): // add_image_size('size-name', height, width, true); } // custom_setup endif; add_action( 'after_setup_theme', 'custom_setup' ); /* ============================================================ LOGO THEME CUSTOMIZER =============================================================*/ function themeslug_theme_customizer( $wp_customize ) { // create a new section for our logo upload $wp_customize->add_section( 'themeslug_logo_section' , array( 'title' => __( 'Logo', 'themeslug' ), 'priority' => 30, 'description' => 'Upload a logo to replace the default site name and description in the header' ) ); // register our new setting $wp_customize->add_setting( 'themeslug_logo', array ( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); // tell the Theme Customizer to let us use an image uploader for setting our logo $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themeslug_logo', array( 'label' => __( 'Logo Image', 'themeslug' ), 'section' => 'themeslug_logo_section', 'settings' => 'themeslug_logo',) ) ); //---------- custom colors text and links $colors = array(); $colors[] = array( 'slug'=>'content_text_color', 'default' => '#333', 'label' => __('Content Text Color', 'custom') ); $colors[] = array( 'slug'=>'content_link_color', 'default' => '#88C34B', 'label' => __('Content Link Color', 'custom') ); foreach( $colors as $color ) { // SETTINGS $wp_customize->add_setting( $color['slug'], array( 'default' => $color['default'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_color_control' ) ); // CONTROLS $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $color['slug'], array('label' => $color['label'], 'section' => 'colors', 'settings' => $color['slug']) ) ); } function sanitize_color_control ($input) { return strip_tags( stripslashes($input) ); } } add_action('customize_register', 'themeslug_theme_customizer'); /* ============================================================ wp_nav FALLBACK =============================================================*/ function custom_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'custom_page_menu_args' ); /* ============================================================ ADD WIDGETIZED AREAS =============================================================*/ function custom_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar Widgets', 'custom' ), 'id' => 'sidebar-1', 'description' => __( 'Widgets displayed in the sidebar on category and archive pages. ', 'custom' ), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Page Template Right Sidebar', 'custom' ), 'id' => 'custom-sidebar', 'description' => __( 'Sidebar displayed on the right', 'custom' ), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Page Template Left Sidebar', 'custom' ), 'id' => 'leftsidebar', 'description' => __( 'Sidebar displayed on the left', 'custom' ), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widgets', 'custom' ), 'id' => 'footer-widgets', 'description' => __( 'Widgets displayed in the footer. Each widget appears to the right of the previous one.', 'custom' ), 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', 'after_title' => '

    ', ) ); } add_action( 'widgets_init', 'custom_widgets_init' ); /* ============================================================ CUSTOM COMMENTS.PHP =============================================================*/ if ( ! function_exists( 'custom_comment' ) ) : // Comments and pingbacks - overrides comments.php function custom_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="li-comment-">
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> max_num_pages < 2 ) { return; } $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); $query_args = array(); $url_parts = explode( '?', $pagenum_link ); if ( isset( $url_parts[1] ) ) { wp_parse_str( $url_parts[1], $query_args ); } $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%'; // Set up paginated links. $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $GLOBALS['wp_query']->max_num_pages, 'current' => $paged, 'mid_size' => 2, 'add_args' => array_map( 'urlencode', $query_args ), //'prev_text' => __( '← Previous', 'custom' ), 'prev_text' => __( '', 'custom' ), 'next_text' => __( '', 'custom' ), 'type' => 'list', ) ); if ( $links ) : ?>