\n";
if(!empty($bgimage)) {
$background_styles = 'background-image: url(\'' . get_theme_mod('background_image', '') . '\');'
. ' background-repeat: ' . get_theme_mod('background_repeat', 'repeat') . ';'
. ' background-position: top ' . get_theme_mod('background_position_x', 'left') . ';' . 'background-attachment: '. get_theme_mod('background_attachment', 'scroll');
echo "body { ".$background_styles."); } \n";
}
if(!empty($bgcolor)) {
echo "body { background-color: #".$bgcolor."; }; \n";
}
if(empty($bgimage) && empty($bgcolor)) {
echo "body { background: #E79233 url( " . get_template_directory_uri() . '/i/bg.png) repeat-x 0 0; }'." \n";
}
echo "";
}
}
}
else {
$cbg = array(
'default-color' => 'E79233',
'default-image' => get_template_directory_uri() . '/i/bg.png'
);
add_theme_support('custom-background', $cbg);
}
add_theme_support('post-formats',
array(
'aside',
'link',
'gallery',
'status',
'quote',
'image'
)
);
add_theme_support('automatic-feed-links');
add_theme_support('post-thumbnails');
add_editor_style();
if ( !isset( $content_width ) ) $content_width = 515;
// threaded comments
function oenology_enqueue_comment_reply() {
if ( is_singular() && comments_open() && get_option(
'thread_comments' ) ) {
wp_enqueue_script('comment-reply');
}
}
add_action('wp_enqueue_scripts', 'oenology_enqueue_comment_reply');
// Custom menu support
function reg_nav_menus() {
register_nav_menus (
array (
'Main' => __('Main sidebar','ar'),
'Secondary' => __('Secondary sidebar','ar'),
)
);
}
add_action('init','reg_nav_menus');
// Header main manu
if(function_exists('register_sidebar'))
register_sidebar(array(
'name' => __('Header main menu','ar'),
'description' => __('The main custom menu in the header of the site, usually used to show Pages.','ar'),
'before_title' => '',
'after_title' => ''
));
// Language switcher
if(function_exists('register_sidebar'))
register_sidebar(array(
'name' => __('Header Language switcher','ar'),
'description' => __('Optional: a reserved place where to insert a menu for the language switcher in the header of the site.','ar'),
'before_title' => '',
'after_title' => '',
'before_widget' => '',
'after_widget' => '',
));
// Footer first widget
if(function_exists('register_sidebar'))
register_sidebar(array(
'name' => __('Footer first widget','ar'),
'description' => __('First widget section in the footer of the site.','ar'),
'before_title' => '
',
'after_title' => '
',
'before_widget' => '',
));
// Footer second widget
if(function_exists('register_sidebar'))
register_sidebar(array(
'name' => __('Footer second widget','ar'),
'description' => __('Second widget section in the footer of the site.','ar'),
'before_title' => '',
'after_title' => '
',
'before_widget' => '',
));
// Footer third widget
if(function_exists('register_sidebar'))
register_sidebar(array(
'name' => __('Footer third widget','ar'),
'description' => __('Third widget section in the footer of the site.','ar'),
'before_title' => '',
'after_title' => '
',
'before_widget' => '',
));
// Footer fourth widget
if(function_exists('register_sidebar'))
register_sidebar(array(
'name' => __('Footer fourth widget','ar'),
'description' => __('Fourth widget section in the footer of the site.','ar'),
'before_title' => '',
'after_title' => '
',
'before_widget' => '',
));
// Footer fifth widget
if(function_exists('register_sidebar'))
register_sidebar(array(
'name' => __('Footer fifth widget','ar'),
'description' => __('Fifth widget section in the footer of the site.','ar'),
'before_title' => '',
'after_title' => '
',
'before_widget' => '',
));
// Footer Sixth widget
if(function_exists('register_sidebar'))
register_sidebar(array(
'name' => __('Footer sixth widget','ar'),
'description' => __('Sixth widget section in the footer of the site.','ar'),
'before_title' => '',
'after_title' => '
',
'before_widget' => '',
));
// Header image
define('HEADER_TEXTCOLOR', '000');
define('HEADER_IMAGE', '');
define('HEADER_IMAGE_WIDTH', apply_filters( 'ar_header_image_width', 1000 ));
define('HEADER_IMAGE_HEIGHT', apply_filters( 'ar_header_image_height', 288 ));
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
add_image_size('large-feature', HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
add_image_size('small-feature', 500, 300);
add_theme_support('custom-header', array( 'random-default' => true ));
add_custom_image_header(
'ar_header_style',
'ar_admin_header_style',
'ar_admin_header_image'
);
register_default_headers(
array(
'AR slider 01' => array(
'url' => '%s/i/headers/ar-slider-01.jpg',
'thumbnail_url' => '%s/i/headers/ar-slider-01.jpg',
'description' => __( 'AR slider 01', 'ar' )
),
'AR slider 02' => array(
'url' => '%s/i/headers/ar-slider-02.jpg',
'thumbnail_url' => '%s/i/headers/ar-slider-02.jpg',
'description' => __('AR slider 02', 'ar')
),
'AR slider 03' => array(
'url' => '%s/i/headers/ar-slider-03.jpg',
'thumbnail_url' => '%s/i/headers/ar-slider-03.jpg',
'description' => __('AR slider 03', 'ar')
)
)
);
if (!function_exists('ar_header_style')) :
function ar_header_style() {
if ( HEADER_TEXTCOLOR == get_header_textcolor() )
return; ?>
>
ID, ARRAY_A);
$slug = $post_data['post_name'];
return $slug;
}
function excerpt() {
add_post_type_support('page','excerpt');
}
add_action('init', 'excerpt');
function excerpt_l($length) {
return 30;
}
add_filter('excerpt_length', 'excerpt_l',999);
function ar_excerpt_link(){
global $post;
return '' . __( 'Continue →', 'ar' ) . '
';
}
function ar_auto_excerpt($more) {
return ' …' . ar_excerpt_link();
}
add_filter('excerpt_more', 'ar_auto_excerpt');
if ( ! function_exists('ar_posted_on')) :
function ar_posted_on() {
printf (
__( 'Posted on by %7$s', 'ar' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date('c') ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta('ID') ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'ar' ), get_the_author() ) ),
get_the_author()
);
}
endif;