add_menu( array( 'parent' => 'appearance', 'title' => __( 'Theme Options','adelle-theme'), 'href' => ''.$home_url.'/wp-admin/themes.php?page=ace_options.php', 'id' => 'theme_options' ) ); } add_action('admin_bar_menu', 'adelle_theme_admin_bar_menu', 100); // ================================================================== // Custom header // ================================================================== if( function_exists('get_custom_header') ) { add_theme_support( 'custom-header', array( 'default-image' => '', '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' => '', )); } // ================================================================== // Custom background // ================================================================== if( function_exists('get_custom_header') ) { add_theme_support('custom-background'); } // ================================================================== // Menu location // ================================================================== register_nav_menu( 'top_menu', __('Top Menu','adelle-theme') ); // ================================================================== // Language // ================================================================== load_theme_textdomain('adelle-theme', get_template_directory() . '/languages'); // ================================================================== // Post thumbnail // ================================================================== add_theme_support('post-thumbnails'); if ( function_exists( 'add_image_size' ) ) { add_image_size( 'post_thumb', 300, 200, true ); } // ================================================================== // Add default posts and comments RSS feed links to head // ================================================================== add_theme_support( 'automatic-feed-links' ); // ================================================================== // Content width // ================================================================== if ( ! isset( $content_width ) ) $content_width = 640; // ================================================================== // 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'); // ================================================================== // Remove version generator // ================================================================== remove_action('wp_head', 'wp_generator'); // ================================================================== // 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' ); // ================================================================== // 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; ?>
' . __('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'), ) ); }