'',
'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' => '',
));
}
// ==================================================================
// Heading
// ==================================================================
function adelle_theme_heading() {
if( get_header_image() == true ) { ?>
'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; ?>
>
= 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 );
// ==================================================================
// Add internal lightbox
// ==================================================================
function ace_add_themescript(){
if( !is_admin() ){
wp_enqueue_script('jquery');
wp_enqueue_script('thickbox',null,array('jquery'));
}
}
function ace_wp_thickbox_script() {
?>
![]()
'',
'link_before' => '',
'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' );