How to change default header image dimensions in twentyfourteen child theme?

The is a filter to the custom header function in the twenty fourteen theme. You can use that to add your new sizes. Here is what I use to change the default size. function wpse_custom_header_setup() { add_theme_support( ‘custom-header’, apply_filters( ‘wpse_header_args’, array( ‘width’ => 1460, ‘height’ => 220, ) ) ); } add_action( ‘after_setup_theme’, ‘wpse_custom_header_setup’ ); … Read more

Different custom header image on different page

create new file in your theme with name header-custom.php next copy this code into that file class customheaderMetabox { private $screen = array( ‘post’, ‘page’, ); private $meta_fields = array( array( ‘label’ => ‘Add Image Header’, ‘id’ => ‘addimageheader_24744’, ‘type’ => ‘media’, ), ); public function __construct() { add_action( ‘add_meta_boxes’, array( $this, ‘add_meta_boxes’ ) ); … Read more

How to use a svg as custom header?

I solved it using the second way. I found out that you have to register the default image also. So after registering the svg as a default header it displays like it should! Here is my code: register_default_headers( array( ‘kami-logo’ => array( ‘url’ => get_stylesheet_directory_uri() . ‘/images/logo.svg’, ‘thumbnail_url’ => get_stylesheet_directory_uri() . ‘/images/logo.svg’, ‘description’ => __( … Read more

How to remove header images from all pages except the home page? skeleton theme

The following one-liner removes regular header images: ! is_admin() && is_front_page() && add_filter( ‘theme_mod_header_image’, ‘__return_false’ ); Usually, header images are saved and retrieved per Theme Modification API, which offers the same filter scheme “theme_mod_$name” for all theme data. Update I see now, the theme is using the post thumbnail as header images on single views: … Read more

add_theme_support( ‘custom-header’ ) does not add option menu in dashboard

From Codex: If attached to a hook, it must be after_setup_theme. The init hook may be too late for some features. Try this if ( ! function_exists( ‘mytheme_setup’ ) ): function mytheme_setup() { add_theme_support( ‘custom-header’ ); } endif; add_action( ‘after_setup_theme’, ‘mytheme_setup’ ); If you use Toolbox Theme, find in functions.php function toolbox_setup() { and add … Read more

Get a sidebar at the top of the page

This method works from your child themes functions.php file. Change the hook to a different position: //functions.php function wpsites_register_widget() { register_sidebar( array( ‘name’ => ‘After Header Widget’, ‘id’ => ‘after-header’, ‘before_widget’ => ‘<div>’, ‘after_widget’ => ‘</div>’, ) ); } add_action( ‘widgets_init’, ‘wpsites_register_widget’ ); add_filter( ‘loop_start’, ‘after_header_widget’, 25 ); function after_header_widget() { if ( is_active_sidebar( ‘after-header’ … Read more

How to Handle CSS for Multiple Header header.php Files?

That’s not how you use get_theme_file_uri(); You need to specify the directory RELATIVE to your currently active theme’s directory. So for example, if your currently activated theme is rm-acf1, and all of your custom header CSS files are located in the subfolder hdr-styles. This is your theme directory: ./wp-content/rm-acf1/ This is your header styles directory: … Read more

How can I add a custom header to a custom template in a plugin without using the theme folders

The get_header() functions is designed for themes. It usually look for header file in child theme first and then parent theme. You should be creating custom header under theme directory instead of in a plugin. But if you really must have to load header file from plugin then you have to create a custom function. … Read more

Custom text-only header

File: functions.php It’s as easy as adding this to your functions.php file (of course having $wpse67109 set). add_theme_support( ‘custom-header’, $wpse67109_defaults ); File: index.php or any other template Simply don’t add the whole get_head_image() and get_custom_header()->foo stuff anywhere. Your headline template part could look like the following example: <header> <hgroup> <h1 class=”site-title”> <?php if ( display_header_text() … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)