'FFFFFF',
'default-image' => get_template_directory_uri() . '/images/bg-grey.png',
);
add_theme_support( 'custom-background', $ast_cust_background );
/*----------------------------------------
Custom Header
-----------------------------------------*/
$ast_cust_header = array(
'default-image' => '',
'random-default' => false,
'width' => asteroid_option('ast_content_width') + asteroid_option('ast_sidebar_width') + 30,
'height' => asteroid_option('ast_header_height'),
'flex-height' => true,
'flex-width' => true,
'default-text-color' => 'FFA900',
'header-text' => true,
'uploads' => true,
'wp-head-callback' => '',
'admin-head-callback' => '',
'admin-preview-callback' => ''
);
add_theme_support( 'custom-header', $ast_cust_header );
/*----------------------------------------
Register Custom Menu
-----------------------------------------*/
if ( function_exists( 'register_nav_menu' ) ) register_nav_menu( 'ast-menu-primary', 'Primary' );
/*----------------------------------------
Add Parent Menu Class
-----------------------------------------*/
function asteroid_add_parent_menu_class( $items ) {
$parents = array();
foreach ( $items as $item ) {
if ( $item->menu_item_parent && $item->menu_item_parent > 0 ) $parents[] = $item->menu_item_parent;
}
foreach ( $items as $item ) {
if ( in_array( $item->ID, $parents ) ) $item->classes[] = 'parent-menu-item';
}
return $items;
}
add_filter( 'wp_nav_menu_objects', 'asteroid_add_parent_menu_class' );
/*----------------------------------------
Register Sidebars
-----------------------------------------*/
if (function_exists( 'register_sidebar' ) ) {
// sidebar widgets
register_sidebar(array(
'name' => __('Sidebar', 'asteroid'),
'id' => 'widgets_sidebar',
'before_widget' => '
',
'before_title' => '',) );
// footer widget full
register_sidebar(array(
'name' => __('Footer: Full Width', 'asteroid'),
'id' => 'widgets_footer_full',
'description' => __('Widget spans the entire width of the footer. Ideal for horizontal banners & 728x90 ads.', 'asteroid'),
'before_widget' => '',
'before_title' => '',) );
// footer widgets
register_sidebar(array(
'name' => __('Footer: 3 Column', 'asteroid'),
'id' => 'widgets_footer_3',
'description' => __('Widgets are arranged into 3 columns.', 'asteroid'),
'before_widget' => '',
'before_title' => '',) );
// Body Widget
if ( asteroid_option('ast_widget_body') == 1 ) {
register_sidebar(array(
'name' => __('Body', 'asteroid'),
'id' => 'widgets_body',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// Header Widget
if ( asteroid_option('ast_widget_header') == 1 ) {
register_sidebar(array(
'name' => __('Header', 'asteroid'),
'id' => 'widgets_header',
'before_widget' => '',
'before_title' => '',) );
}
// Below Menu
if ( asteroid_option('ast_widget_below_menu') == 1 ) {
register_sidebar(array(
'name' => __('Below Menu', 'asteroid'),
'id' => 'widgets_below_menu',
'description' => __('Widget spans the entire width of the container. Ideal for horizontal banners & 728x90 ads.', 'asteroid'),
'before_widget' => '',
'before_title' => '',) );
}
// Before Content
if ( asteroid_option('ast_widget_before_content') == 1 ) {
register_sidebar(array(
'name' => __('Before Content', 'asteroid'),
'id' => 'widgets_before_content',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// Below Excerpts
if ( asteroid_option('ast_widget_below_excerpts') == 1 ) {
register_sidebar(array(
'name' => __('Below Excerpts', 'asteroid'),
'id' => 'widgets_below_excerpts',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// Before Post
if ( asteroid_option('ast_widget_before_post') == 1 ) {
register_sidebar(array(
'name' => __('Before Post', 'asteroid'),
'id' => 'widgets_before_post',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// Before Post Content
if ( asteroid_option('ast_widget_before_post_content') == 1 ) {
register_sidebar(array(
'name' => __('Before Post - Content', 'asteroid'),
'id' => 'widgets_before_post_content',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// After Post Content
if ( asteroid_option('ast_widget_after_post_content') == 1 ) {
register_sidebar(array(
'name' => __('After Post - Content', 'asteroid'),
'id' => 'widgets_after_post_content',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// After Post
if ( asteroid_option('ast_widget_after_post') == 1 ) {
register_sidebar(array(
'name' => __('After Post', 'asteroid'),
'id' => 'widgets_after_post',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// Before Page
if ( asteroid_option('ast_widget_before_page') == 1 ) {
register_sidebar(array(
'name' => __('Before Page', 'asteroid'),
'id' => 'widgets_before_page',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// Before Page Content
if ( asteroid_option('ast_widget_before_page_content') == 1 ) {
register_sidebar(array(
'name' => __('Before Page - Content', 'asteroid'),
'id' => 'widgets_before_page_content',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// After Page Content
if ( asteroid_option('ast_widget_after_page_content') == 1 ) {
register_sidebar(array(
'name' => __('After Page - Content', 'asteroid'),
'id' => 'widgets_after_page_content',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
// After Page
if ( asteroid_option('ast_widget_after_page') == 1 ) {
register_sidebar(array(
'name' => __('After Page', 'asteroid'),
'id' => 'widgets_after_page',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',) );
}
}
/*----------------------------------------
Set $content_width
-----------------------------------------*/
if ( ! isset( $content_width ) ) {
$content_width = asteroid_option('ast_content_width');
}
/*-------------------------------------
Head Codes
--------------------------------------*/
function asteroid_print_head_codes() {
echo "\n\n" . '' . "\n";
if (! ( asteroid_option('ast_favicon') == '' ) ) {
echo '' . "\n";
}
echo asteroid_option('ast_head_codes') . "\n";
echo '' . "\n\n";
}
add_action( 'wp_head', 'asteroid_print_head_codes' );
/*-------------------------------------
Header Background
--------------------------------------*/
function asteroid_header_image() {
if (!( get_header_image() == '' )) {
echo '' . "\n\n";
}
}
add_action( 'wp_head', 'asteroid_header_image' );
/*-------------------------------------
Header Text Color
--------------------------------------*/
function asteroid_header_text_color() {
if (!( get_header_textcolor() == 'FFA900' )){
echo '' . "\n";
}
}
add_action( 'wp_head', 'asteroid_header_text_color' );
/*-------------------------------------
Container Layout
--------------------------------------*/
function asteroid_print_layout() {
$content_x = asteroid_option('ast_content_width');
$sidebar_x = asteroid_option('ast_sidebar_width');
echo "\n" . '';
}
add_action( 'wp_head', 'asteroid_print_layout', 600 );
/*-------------------------------------
Custom CSS
--------------------------------------*/
function asteroid_print_custom_css() {
echo "\n\n" . '' . "\n";
echo '' . "\n";
echo '' . "\n\n";
}
add_action( 'wp_head', 'asteroid_print_custom_css', 990 );
/*-------------------------------------
Footer Codes
--------------------------------------*/
function asteroid_do_hook_footer_links() {
if (!( asteroid_option('ast_hook_footer_links') == '' )) echo asteroid_option('ast_hook_footer_links');
}
add_action( 'ast_hook_footer_links', 'asteroid_do_hook_footer_links' );
/*----------------------------------------
RSS feed links on Head
-----------------------------------------*/
add_theme_support( 'automatic-feed-links' );
/*----------------------------------------
Add support for Thumbnails
-----------------------------------------*/
add_theme_support( 'post-thumbnails' );
/*----------------------------------------
Add Custom CSS to Post Editor
-----------------------------------------*/
if ( asteroid_option('ast_post_editor_style') == 0 ) add_editor_style('library/editor-style.css');
/*----------------------------------------
Shortcodes on Text Widget
-----------------------------------------*/
add_filter( 'widget_text', 'do_shortcode');
/*-------------------------------------
Remove WordPress Generator
--------------------------------------*/
if ( asteroid_option('ast_remove_wp_version') == 1 ) {
remove_action( 'wp_head', 'wp_generator' );
}
/*-------------------------------------
Remove rel from Categories
HTML5 Validation
--------------------------------------*/
function asteroid_remove_category_rel($output){
$output = str_replace(' rel="category tag"', '', $output);
return $output;
}
add_filter('wp_list_categories', 'asteroid_remove_category_rel');
add_filter('the_category', 'asteroid_remove_category_rel');