esc_html__('Primary', 'bukaba'), 'social-footer' => esc_html__('Social Links Footer', 'bukaba') ) ); /* This registers the header customisations including image and header text colour */ $header_info = array ( 'default-image' => get_parent_theme_file_uri('/assets/images/grey.jpg'), 'default-text-color' => '000000', 'width' => 1000, 'height' => 250, 'flex-height' => true, 'flex-width' => true, 'wp-head-callback' => 'bukaba_header_style', ); add_theme_support('custom-header', $header_info); // set default header images $header_images = array( 'grey' => array ( 'url' => '%s/assets/images/grey.jpg', 'description' => __('Grey', 'bukaba'), 'thumbnail_url' => '%s/assets/images/grey.jpg', ), 'blue' => array ( 'url' => '%s/assets/images/blue.jpg', 'description' => __('Blue', 'bukaba'), 'thumbnail_url' => '%s/assets/images/blue.jpg', ), ); register_default_headers($header_images); /* This will register theme support for logos and customise the logo */ $defaults = array ( 'height' => 100, 'width' => 100, ); add_theme_support('custom-logo', $defaults); /* This will register theme support for post formats */ add_theme_support('post-formats', array('aside', 'quote', 'link', 'image')); /* This will register theme support for post thumbnails */ add_theme_support('post-thumbnails', array('post', 'image')); /* This will register theme support for html5 */ add_theme_support('html5'); /* This will register theme support for aautomatic feed links */ add_theme_support('automatic-feed-links'); /* Registers theme support for WordPress Titles */ add_theme_support( 'title-tag' ); /* Set up the WordPress core custom background feature. */ add_theme_support( 'custom-background', apply_filters( 'bukaba_custom_background_args', array( 'default-color' => '#FFFFF0', 'default-image' => '', ) ) ); /* set the content width */ function bukaba_content_width() { $GLOBALS['content_width'] = apply_filters( 'bukaba_content_width', 640 ); } } //end of theme setup function add_action( 'after_setup_theme', 'bukaba_setup' ); //function to add styling for the header text colour if (! function_exists('bukaba_header_style')): function bukaba_header_style() { $text_colour = get_header_textcolor(); if(get_theme_support( 'custom-header', 'default-text-color' ) === $text_colour) { return; } else { ?> "Home", "post_status" => "publish", "post_type" => "page", "menu_order" => "-100", "page_template" => "single-page-home.php" ); wp_insert_post($post); $home_page = get_page_by_title("Home"); update_option("page_on_front", $home_page->ID); update_option("show_on_front", "page"); } /* Function to link the main menu items to the internal parts of the single page home page - the link for the post should not take the user to another page but the page location on the single page homepage. Preconditions for this function are 1. Front page is a static front page 2. Home page template is the single-page-home.php page 3 The menu location is 'primary' so no other navs are affected */ function bukaba_main_nav_menu_reroute($items, $args) { if(get_option('show_on_front') == 'page' && get_page_by_title("Home")->page_template =="single-page-home.php" && $args->theme_location == 'primary') { $items=""; $filters = array ("post_type" => "page", "order" => "ASC", "orderby" => "menu_order"); $the_query = new WP_Query($filters); if($the_query->have_posts()): while($the_query->have_posts()): $the_query->the_post(); $items .= '