ildi-wp/functions.php
2018-08-09 08:57:22 -05:00

85 lines
2.7 KiB
PHP

<?php
require_once( __DIR__ . '/includes/supporters-widget.php');
if (function_exists('add_theme_support')) {
add_theme_support('automatic-feed-links');
add_theme_support('post-thumbnails');
// add_image_size('large', 700, '', true);
// add_image_size('medium', 250, '', true);
// add_image_size('small', 120, '', true);
// add_image_size('custom-size', 700, 200, true); // call using the_post_thumbnail('custom-size');
$customHeaderArgs = array(
'default-image' => get_template_directory_uri() . '/images/default-header.jpg',
'width' => 1800,
'height' => 260,
'flex-height' => true,
'flex-width' => true,
'uploads' => true,
'header-text' => true,
);
add_theme_support( 'custom-header', $customHeaderArgs );
add_theme_support( 'html5', array( 'search-form' ) );
}
function ildi_nav($location='header-menu') {
wp_nav_menu(
array(
'theme_location' => $location,
'menu' => '',
'container' => '',
'container_class' => '',
'container_id' => '',
'menu_class' => $location,
'menu_id' => '',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul class="%2$s">%3$s</ul>',
'depth' => 0,
'walker' => ''
)
);
}
function ildi_styles() {
wp_register_style('ildi', get_template_directory_uri() . '/style.css', array(), '1.0', 'all');
wp_enqueue_style('ildi');
}
function register_ildi_menus() {
register_nav_menus(array(
'header-menu' => __('Header Menu', 'ildi'),
'social-menu' => __('Social Links', 'ildi'),
'footer-menu' => __('Footer Menu', 'ildi')
));
}
function ildi_register_sidebars() {
// 'description' => __( 'This is the sponsor and partner logos section of the footer and should display a "Sponsors" widget.', 'ildi' ),
register_sidebar(
array(
'id' => 'footer-sponsors',
'name' => __( 'Footer Sponsors', 'ildi' ),
'description' => __( 'This is the sponsor and partner logos section of the footer.', 'ildi' ),
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h1>',
'after_title' => '</h1>',
)
);
}
// add_action('init', 'register_ildi_menu');
add_action( 'after_setup_theme', 'register_ildi_menus', 0 );
add_action( 'wp_enqueue_scripts', 'ildi_styles' );
add_action( 'widgets_init', 'ildi_register_sidebars');
// add_action( 'widgets_init', function() { register_widget( 'Sponsors_Widget' ); } );
?>