This code adds theme support for custom headers which adds a new page under Appearance in the wp dashboard.
function themes_custom_header_setup() {
add_theme_support( 'custom-header', $defaults, array(
'default-text-color' => 'fff',
'width' => 1260,
'height' => 240,
'flex-height' => true,
'wp-head-callback' => 'themes_header_style',
'admin-head-callback' => 'themes_admin_header_style',
'admin-preview-callback' => 'themes_admin_header_image',
) ) );
}
add_action( 'after_setup_theme', 'themes_custom_header_setup' );
You can add/remove default arguments in the above code.
Source http://codex.wordpress.org/Function_Reference/add_theme_support
Then you can look in the header.php file of a theme like Twenty Fourteen to see how its coded.
Related Posts:
- How to get the custom header image’s alt text?
- Mysterious HTTP 404 header in my own scripts
- Changing custom logo link
- From where the header-text can be changed in WordPress custom header?
- is_page_template showing partial results
- If i use a child theme to add new code blocks to header.php, how does it get inserted in the right place in parent’s header.php?
- Adding theme support for a custom header image
- How to implement a custom sliding banner? [closed]
- Create custom API endpoint to change custom header image
- How do I make a redirect in PHP?
- Retrieve POST data from AJAX call
- Display all meta for a post?
- How to include external page to wordpress page?
- Facebook Comment Count
- How to overwrite youtube embed?
- How to resize image on client-side before upload?
- Filter the blog title displayed in the header
- Print html when custom field has value inside while loop
- Foreach insert query the best way
- Generating add_settings_section() calls dynamically
- How to generate page content from database the right way?
- Register non hierarchical taxonomy and the show meta box in the post type
- Admin username and password
- dynamic php inside wordpress page
- Converting MYSQL to WordPress $WPDB
- Random Default Avatar Function
- Get Admin Email Address From External PHP page
- Redirect to another page after submission using wp_mail
- How to run a php file that uses wordpress functions from command line?
- Loop with slider (slider not loading)
- wordpress media library new uploads don’t write to database
- Add data attribute to each li in menu
- Was told to change the .htacess file form .html to .php so this would work properly
- How to bypass maintenance mode with external cron?
- Displaying Woocommerce Product Category in WordPress
- Split reads to a different connection string
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- PHP > Scheduled Tasks > Sending daily email with dynamic API variables
- “Undefined index” error when saving empty array with checkboxes
- WordPress comment submit button substitutes/options
- How to make container class in PHP
- Copy taxonomy terms from one post to another programmatically
- Where is the PHP code generating an element?
- How do I check or test a WordPress Auto Year Change Script?
- Prevent redirect to wp-login.php
- Insert page content into another page with a changed variable
- Decimal values via get_option() with custom local (decimal point = comma)
- WordPress and PHP Version Upgrade issue [closed]
- Pull MySQL data from multiple tables and merge into 1 PHP array
- Images Uploaded saving onto older/previous year folders
- PHP Redirect condition
- How to hide the author box of a specific user?
- Find out last 7 days of upload images, last week uploaded image from Gallery and display them in different pages
- Add date before entry title in Twenty Twelve
- Where can I find linked fonts in my theme?
- Undefined variable: row?
- WordPress theme showing blank page
- Finding and removing duplicates within WP Arrays
- How can I call a specific file (via php) by referencing the logged-in username?
- save_post action inside a custom metabox class not working
- Hard-coding a shortcode as the last menu item in primary navigation?
- quotes problem in very simple sql
- Blog suddenly shows Archive instead of index page
- WP-CLi PHP Warning: mysqli_query(): (HY000/1356): View During Search Replace
- The additional fee for the COD payment method not visible in the front-end
- WordPress is removing query variables like page, p from the URL of a custom static page
- PHP identify duplicate words in a text string against a list of words
- If the_title starts containing the same characters as the_content then
- How to add and subtract user meta values after post meta update
- how can i redirect dynamic URL in worpress base on ID in htaccess or wp-config or function.php
- Multiple AJAX handler functions conflict in functions.php
- How to check if is page template inside functions.php
- How to hide a div section when user is logged in, in single product woocommerce
- Global variable doesnt’t pass to another function
- PHP Error in WordPress Theme
- PHP 7.2 Challenge
- my_meta not saving in my current hosting
- Blog Image and Title in Right Sidebar
- Creating a WordPress addon for ContactForm7 submission (.XML file export)
- Generate random access token to a post page
- Filter loop by ‘price’ with meta_query
- (Who to follow) Twitter widget
- Singleton in plugin fails on AJAX call (Plugin initialzed again)
- How save data on user’s client cache
- How to always display full size image
- Updating Lat and Lng of posts automatically gives sporadic results
- Find the method which AJAX GET calls
- Problems with the WordPress loop [closed]
- Multilanguage website on two different domains
- White screen after login attempt
- Convert ACF checkbox choices to links [closed]
- How to modify this function to exclude also the post belonging to a specific category?
- index.php file keeps redirecting to a non-existent index.html file?
- How to pass parameter to another url?
- HTTP 500 Error after Creating Shortcode
- Show button in header when product custom field is not empty
- Why a class property becomes empty?
- how to goto specific page number including title with permalink
- WordPress PHP8 Critical Error in class-wp-widget.php
- How to get the last date updated of postmeta?