add_section( 'analogous_logo_section' , array(
'title' => __( 'Logo', 'analogous' ),
'priority' => 30,
'description' => 'Upload a logo to replace the default site name and description in the header',
));
$wp_customize->add_setting( 'analogous_logo', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'analogous_logo', array(
'label' => __( 'Logo', 'analogous' ),
'section' => 'analogous_logo_section',
'settings' => 'analogous_logo',
)));
}
require get_template_directory() . '/inc/customizer.php';
//Set Content Width
if ( ! isset( $content_width ) ) $content_width = 900;
/**
* Enqueue scripts and styles
*/
function theme_name_scripts() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
// Search Menu
add_filter('wp_nav_menu_items', 'add_analogous_search_form_to_menu', 10, 2);
function add_analogous_search_form_to_menu($items, $args) {
if( !($args->theme_location == 'main') ) {
return $items;
}
return $items . '
' . get_analogous_search_form(false) . '
';
}
// Add Your Menu Locations
function register_my_menus() {
register_nav_menus(
array('primary_navigation' => __( 'Primary Menu','analogous' ), 'secondary_navigation' => __( 'Secondary Menu','analogous' )) );
}
add_action( 'init', 'register_my_menus' );
/* Register widgetized area and update sidebar with default widgets */
function analogous_sidebar_widgets_init() {
register_sidebar( array(
'name' => __( 'Main sidebar', 'analogous' ),
'id' => 'side_bar',
'description' => __( 'The main sidebar appears on the right on each page except the front page template', 'analogous' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
}
function analogous_footer_widget1_init() {
register_sidebar( array(
'name' => __( 'Footer widget1', 'analogous' ),
'id' => 'analogous_footer_widget1',
'description' => __( 'The Footer Widget1 appears on the right on each page except the front page template', 'analogous' ),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
}
function analogous_footer_widget2_init() {
register_sidebar( array(
'name' => __( 'Footer widget2', 'analogous' ),
'id' => 'analogous_footer_widget2',
'description' => __( 'The Footer Widget1 appears on the right on each page except the front page template', 'analogous' ),
'before_widget' => '',
'before_title' => '
',
'after_title' => '
',
) );
}
function analogous_footer_widget3_init() {
register_sidebar( array(
'name' => __( 'Footer widget3', 'analogous' ),
'id' => 'analogous_footer_widget3',
'description' => __( 'The Footer Widget1 appears on the right on each page except the front page template', 'analogous' ),
'before_widget' => '',
'before_title' => '
$depth, 'max_depth' => $args['max_depth']))) ?>