'FFFFFF', 'wp-head-callback' => 'afford_custom_background_cb')); /** * Adds title tag automatically */ add_theme_support( 'title-tag' ); /** * Adds supports for Theme menu. * Afford uses wp_nav_menu() in a single location to diaplay one single menu. */ register_nav_menu('primary', __('Primary Menu','afford')); /** * Add support for Post Thumbnails. * Defines a custom name and size for Thumbnails to be used in the theme. * * Note: In order to use the default theme thumbnail, add_image_size() must be removed * and 'afford-thumb' value must be removed from the_post_thumbnail in the loop file. */ add_theme_support('post-thumbnails'); add_image_size('afford-thumb', 190, 130, true); } add_action( 'after_setup_theme', 'afford_setup' ); /** * Callback for custom background * * @see wp-includes/theme.php function _custom_background_cb() * @return string Custom CSS */ function afford_custom_background_cb() { // $background is the saved custom image, or the default image. $background = set_url_scheme(get_background_image()); // $color is the saved custom color. // A default has to be specified in style.css. It will not be printed here. $color = get_background_color(); if ($color === get_theme_support('custom-background', 'default-color')) { $color = false; } if (!$background && !$color) return; $style = $color ? "background-color: #$color;" : ''; if ($background) { $image = " background-image: url('$background');"; $repeat = get_theme_mod('background_repeat', get_theme_support('custom-background', 'default-repeat')); if (!in_array($repeat, array('no-repeat', 'repeat-x', 'repeat-y', 'repeat'))) $repeat = 'repeat'; $repeat = " background-repeat: $repeat;"; $position = get_theme_mod('background_position_x', get_theme_support('custom-background', 'default-position-x')); if (!in_array($position, array('center', 'right', 'left'))) $position = 'left'; $position = " background-position: top $position;"; $attachment = get_theme_mod('background_attachment', get_theme_support('custom-background', 'default-attachment')); if (!in_array($attachment, array('fixed', 'scroll'))) $attachment = 'scroll'; $attachment = " background-attachment: $attachment;"; $style .= $image . $repeat . $position . $attachment; } ?> 'primary', 'container_id' => 'menu', 'menu_class' => 'sf-menu afford_menu', 'menu_id' => 'afford_menu', 'fallback_cb' => 'afford_nav_fallback' // Fallback function in case no menu item is defined. )); } /** * Displays a custom menu in case either no menu is selected or * menu does not contains any items or wp_nav_menu() is unavailable. * * @since 1.0 */ function afford_nav_fallback() { ?> __('Right Sidebar', 'afford'), 'id' => 'right_sidebar', 'description' => __('Right Sidebar', 'afford'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); // Footerbox Sidebar #1 register_sidebar(array( 'name' => __('Footerbox Sidebar #1', 'afford'), 'id' => 'footerbox_sidebar_1', 'description' => __('Footerbox Sidebar #1', 'afford'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); // Footerbox Sidebar #2 register_sidebar(array( 'name' => __('Footerbox Sidebar #2', 'afford'), 'id' => 'footerbox_sidebar_2', 'description' => __('Footerbox Sidebar #2', 'afford'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); // Footerbox Sidebar #3 register_sidebar(array( 'name' => __('Footerbox Sidebar #3', 'afford'), 'id' => 'footerbox_sidebar_3', 'description' => __('Footerbox Sidebar #3', 'afford'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action( 'widgets_init', 'afford_sidebars' ); /** * Enqueue CSS and JS files * * @since 1.0 */ function afford_enqueue() { wp_enqueue_style('google-font-lato', '//fonts.googleapis.com/css?family=Lato:400,100italic,100,300,300italic,700,700italic,900,900italic'); wp_enqueue_style('afford-font-awesome', AFFORD_ADMIN_CSS_URL . 'font-awesome.4.1.0.css'); wp_enqueue_style('afford-stylesheet', get_stylesheet_uri(), false, '1.0.0', 'all' ); // Enqueue (comment-reply )Javascript in case of threaded comments. if (is_singular() && comments_open() && get_option('thread_comments')) : wp_enqueue_script('comment-reply'); endif; wp_enqueue_script('afford-superfish', AFFORD_GLOBAL_JS_URL . 'superfish.min.js', array( 'jquery' ), '1.4.8', true); wp_enqueue_script('jquery-color'); wp_enqueue_script('afford-custom', AFFORD_GLOBAL_JS_URL . 'custom.js', array( 'jquery' ), '1.0.0', true); } add_action( 'wp_enqueue_scripts', 'afford_enqueue'); /** * Hooks respond.js for IE in the wp_head hook. * * @since 1.0 */ function afford_enqueue_ie_script() { echo "\n"; ?>'; } return $output; } /** * Used to display social section * * @since 1.0 */ function afford_social_section_show() { if(!afford_get_option('disable_social_section')): $output = false; $output .= afford_get_social_section_individual_icon('facebook', __('Facebook', 'afford'), 'facebook'); $output .= afford_get_social_section_individual_icon('twitter', __('Twitter', 'afford'), 'twitter'); $output .= afford_get_social_section_individual_icon('rss', __('RSS feed', 'afford'), 'rss'); ?>

max_num_pages > 1): ?>
comment_type ): case '' : // Proceed with normal comments. ?>
  • id="li-comment-"> comment_approved == '0') : ?>
    comment_parent ?> comment_parent) ?>
    ', sprintf('%s', get_comment_author_link())) ?>
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ', '
    ');?>
  • ID}\">".__('Read more', 'afford').""; } add_filter('the_content_more_link', 'afford_wp_readmore_link', 100, 2); /** * Outputs CSS for customizer options * * @since 1.0 */ function afford_customizer_css() { $output = ''; $options_color = array( 'color_site_title' => '#wrapper .site-title a', 'color_site_desc' => '#wrapper .site-description', 'color_blog_p_title' => '#wrapper .loop-post-title h1 a', 'color_blog_p_meta' => '#wrapper .loop-post-meta, #wrapper .loop-post-meta .loop-meta-comments a', 'color_blog_p_content' => '#wrapper .loop-post-excerpt', 'color_p_title' => '#wrapper .post-title h1', 'color_p_meta' => '#wrapper .post-meta', 'color_p_content' => '#wrapper .post-content', ); $output .= "\n" . '' . "\n"; echo $output; } add_action('wp_head', 'afford_customizer_css');