registered['adelle-ie9']->add_data( 'conditional', 'lt IE 9' ); $wp_styles->registered['adelle-html5']->add_data( 'conditional', 'lt IE 9' ); } add_action('wp_enqueue_scripts', 'adelle_theme_scripts'); // ================================================================== // Heading // ================================================================== function adelle_theme_heading() { if( get_header_image() == true ) { ?> <?php bloginfo('name'); ?>

'', 'random-default' => false, 'width' => 400, 'height' => 100, 'flex-height' => true, 'flex-width' => true, 'default-text-color' => '', 'header-text' => false, 'uploads' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', )); // ================================================================== // Language // ================================================================== load_theme_textdomain('adelle-theme', get_template_directory() . '/languages'); // ================================================================== // Add default posts and comments RSS feed links to head // ================================================================== add_theme_support( 'automatic-feed-links' ); // ================================================================== // Post thumbnail // ================================================================== add_theme_support('post-thumbnails'); add_image_size( 'post_thumb', 300, 200, true ); // ================================================================== // Menu location // ================================================================== register_nav_menu( 'top_menu', __('Top Menu','adelle-theme') ); // ================================================================== // Custom background // ================================================================== add_theme_support( 'custom-background', array('default-color' => 'ffffff',) ); // ================================================================== // Visual editor stylesheet // ================================================================== add_editor_style('editor.css'); // ================================================================== // Shortcode in excerpt // ================================================================== add_filter('the_excerpt', 'do_shortcode'); // ================================================================== // Shortcode in widget // ================================================================== add_filter('widget_text', 'do_shortcode'); // ================================================================== // Clickable link in content // ================================================================== add_filter('the_content', 'make_clickable'); // ================================================================== // Add "Home" in menu // ================================================================== function adelle_theme_home_page_menu( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'adelle_theme_home_page_menu' ); // ==================================================================================================================================== // Innit // ==================================================================================================================================== } add_action( 'after_setup_theme', 'adelle_setup' ); // ================================================================== // Comment spam, prevention // ================================================================== function adelle_theme_check_referrer() { if (!isset($_SERVER['HTTP_REFERER']) || $_SERVER['HTTP_REFERER'] == "") { wp_die( __('Please enable referrers in your browser.','adelle-theme') ); } } add_action('check_comment_flood', 'adelle_theme_check_referrer'); // ================================================================== // Comment time // ================================================================== function adelle_theme_time_ago( $type = 'comment' ) { $d = 'comment' == $type ? 'get_comment_time' : 'get_post_time'; return human_time_diff($d('U'), current_time('timestamp')) . " " . __('ago','adelle-theme'); } // ================================================================== // Custom comment style // ================================================================== function adelle_theme_comment_style($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • >
    %s','adelle-theme'), get_comment_author_link()) ?> ()
    comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>
    = 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'adelle' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'adelle_theme_wp_title', 10, 2 ); // ================================================================== // Post/page pagination // ================================================================== function adelle_theme_get_link_pages() { wp_link_pages( array( 'before' => '

    ' . __('Pages:','adelle-theme') . '', 'after' => '

    ', 'link_before' => '', 'link_after' => '', 'next_or_number' => 'number', 'nextpagelink' => __('Next page','adelle-theme'), 'previouspagelink' => __('Previous page','adelle-theme'), 'pagelink' => '%', 'echo' => 1 ) ); } // ================================================================== // Pagination (WordPress) // ================================================================== function adelle_theme_pagination_links() { global $wp_query; $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; $big = 999999999; return paginate_links( array( 'base' => @add_query_arg('paged','%#%'), 'format' => '?paged=%#%', 'current' => $current, 'total' => $wp_query->max_num_pages, 'prev_next' => true, 'prev_text' => __('Previous','adelle-theme'), 'next_text' => __('Next','adelle-theme'), ) ); } // ================================================================== // NextGen conflict // ================================================================== include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if (is_plugin_active('nextgen-gallery/nggallery.php')) { remove_action( 'admin_print_scripts', 'add_quicktag' ); } // ================================================================== // Widget - Sidebar // ================================================================== function adelle_widgets_init() { register_sidebar(array( 'name' => __('Right Widget 1','adelle-theme'), 'id' => 'right-widget', 'description' => 'Right side widget area', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', )); } add_action( 'widgets_init', 'adelle_widgets_init' );