From 414efaa757e8d72ef7e75e6702f39ad8b03663ae Mon Sep 17 00:00:00 2001 From: fcojgodoy Date: Wed, 28 Dec 2016 10:45:39 +0100 Subject: [PATCH] add Custom Headers theme function --- functions.php | 3 ++- lib/custom-headers.php | 33 +++++++++++++++++++++++++++++++++ lib/piklist-checker.php | 7 ++++--- templates/header.php | 10 +++++++--- 4 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 lib/custom-headers.php diff --git a/functions.php b/functions.php index 543f9c7..42f9276 100644 --- a/functions.php +++ b/functions.php @@ -20,7 +20,8 @@ 'lib/customizer.php', // Theme customizer 'lib/userfields.php', // Add user's fields 'lib/custom-logo.php', // Add Theme logo support - 'lib/piklist-checker.php' // Add Piklist Checker + 'lib/piklist-checker.php', // Add Piklist Checker + 'lib/custom-headers.php' // Add Custom Headers support ]; foreach ($sage_includes as $file) { diff --git a/lib/custom-headers.php b/lib/custom-headers.php new file mode 100644 index 0000000..de4fe9b --- /dev/null +++ b/lib/custom-headers.php @@ -0,0 +1,33 @@ + get_template_directory_uri() . '/images/headers/default.jpg', + // Display the header text along with the image + 'header-text' => true, + // Header text color default + 'default-text-color' => '000', + // Header image width (in pixels) + 'width' => 1000, + // Header image height (in pixels) + 'height' => 198, + // Width will be used as suggested dimensions instead + 'flex-width' => true, + // Height will be used as suggested dimensions instead + 'flex-height' => true, + // Header image random rotation default + 'random-default' => false, + // Enable upload of image file in admin + 'uploads' => true, + // function to be called in theme head section + 'wp-head-callback' => 'wphead_cb', + // function to be called in preview page head section + 'admin-head-callback' => 'adminhead_cb', + // function to produce preview markup in the admin screen + 'admin-preview-callback' => 'adminpreview_cb', + ); +} +add_action( 'after_setup_theme', __NAMESPACE__ . '\\themename_custom_header_setup' ); diff --git a/lib/piklist-checker.php b/lib/piklist-checker.php index 1d9d04a..d9aa008 100644 --- a/lib/piklist-checker.php +++ b/lib/piklist-checker.php @@ -1,9 +1,10 @@ - -