3

This is my proposal, combine get_ancestors and a custom $wpdb query, to retrieve featured images. An example custom function: function inherited_featured_image( $page = NULL ) { if ( is_numeric( $page ) ) { $page = get_post( $page ); } elseif( is_null( $page ) ) { $page = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : NULL; } if ( ! $page ...


3

I found (part) of the css code that controls the height in wp-content/themes/twentyseventeen/style.css. There is code that applies when the admin bar is not visible (typical anonymous user) currently at line 3629 .twentyseventeen-front-page.has-header-image .custom-header-media, .twentyseventeen-front-page.has-header-video .custom-header-media, .home.blog....


3

I solved this installing the next library sudo apt-get install php5-gd -> for php5 sudo apt-get install php7.0-gd -> for php7 sudo apt-get install php7.2-gd -> for php7.2


2

Depends on what theme you are using because some include hooks which make the job easier. For themes which don't include hooks like Twenty Eleven & Twenty Twelve, you can simply past the PHP tag for the slider into the header.php file in the position you want your slider to display. Example if using the free version of Soliloquy: <?php if ( ...


2

You could add an ID as post_parent to the attachment of the header image via wp_update_post() (even though this seems to be a very very hacky way to do it!) The tricky part is to get the ID out of the attachment URL; fortunately Rarst solved this issue long time ago, so you can manually add get_attachment_id() to your functions. Next you'll have to assign ...


2

As @Michael says, header_image() returns the URL, you need to echo it: <img src="<?php echo esc_url( header_image() ) ?>" ...


2

On the else if there is missing a closing bracket: } elseif ( is_page(1) ) {. Since all you alter is the file name, it's sufficient to use the following code: if ( is_home() ) $my_header_image = get_header_image(); elseif ( is_page(1) ) $my_header_image = "http://.../ImageB.png"; elseif ( is_... ) $my_header_image = ...; else... ?> <img src="<?php ...


2

in Twenty Eleven, any featured image in a post or static page, with image dimensions larger than the size of the header image - 1000px width in the unedited theme - will automatically get used for the header image.


2

The following code will cycle between the 9 pics. 1st day of the year = pic0, 2nd = pic1...359th = pic9, 360th = pic0, etc. <?php $pic_array = array( 'pic0', 'pic1', 'pic2', 'pic3', 'pic4', 'pic5', 'pic6', 'pic7', 'pic8', ); $d = (int) date('z') % 9; $todays_pic = $pic_array[$d]; echo $todays_pic; Hopefully you're ...


2

First of all, do not change any files in the twenty thirteen theme. The reason been, twenty thirteen is updated regulary, so if you made changes to the theme, you WILL loose everything you have done to the theme. You should create a child theme You need to change the function that set the header height to get your image correctly cropped. This function can ...


2

Just edit the theme from the dashboard and add the following CSS definition into the theme section "custom css": .has-header-image.home.blog .custom-header { height: 26vh; }


2

If you have FTP access than you can set password with wp_set_password('password', 1); https://codex.wordpress.org/Resetting_Your_Password#Through_FTP https://codex.wordpress.org/Function_Reference/wp_set_password or via database if you have access to phpMyAdmin according to http://www.devlounge.net/publishing/reset-a-wordpress-password-from-phpmyadmin


2

You did not mention or shown in the code to which hook are you hooking the above code to, but here's what I think should work. NOT TESTED global $post; $header_image = ''; // featured image is first priority, right? if ( has_post_thumbnail( $post->ID ) ) { $header_image = get_the_post_thumbnail_url( $post->ID, 'full' ); } elseif ( !empty( ...


2

No, in general, it's not possible to use php in CSS. But you can set background image in php file. Like.. <div class="headerimg" style="background-image: url(<?php echo header_image(); ?>)"></div> Then in CSS file using class you can set all the other properties you need like height, width, background-position and so on.


2

Your tag is using 2 identifiers instead of one id="masthead masthead_custom" class="masthead_custom" id="masthead" will correct your problem. #masthead.masthead_custom { background-image: url("./bg.jpg"); background-color: #444; height: 100vh; background-position: center; background-repeat: no-repeat; background-size: cover; ...


2

There is too little information to be completely sure, but usually this error occurs when WordPress cannot find the graphic library which should be installed on your server. So you should check with your provider to see if Imagick and/or GD are installed. You can also add this little snippet of code in your functions.php file to make sure WordPress looks ...


1

From a comment I made in @User's answer (that's a cool name) ;) I thought I would give it a go. I am editing the theme file directly because I am working in a throw-away docker container, it is more proof of concept. Adapting it to a child theme will need some tweaking. In content/themes/twentyseventeen/style.css in the area between 3680~3670ish is where ...


1

The header-text option in the custom header allows you to switch off the header text, not to change its content. You can change the header text in the customizer. To show it in your front end you must must use echo get_bloginfo('name') for the blog title and echo get_bloginfo('description') for the tagline.


1

You can do it by adding some code or by installing a plugin. You can add the following code inside your loop: if (in_category('news')) { get_header('news'); } else { get_header(); } This code checks if the current post belongs to a category that's called news, and if that's true, then it will use header-news.php instead of header.php. You will ...


1

If you are using a recent version of wordpress it gives you the option of changing the header image in the CUSTOMIZE menu option (left bar under APPEARANCE) when you upload a new image it will ask you to crop it to the position you want. If you have otherwise uploaded a replacement image via FTP (or other method) then you might try adding .site-header { ...


1

Your theme's files will be located in your 'wp-content/themes directory'. The file you are looking for is your 'header.php'. This might help to solve your problem.


1

You need to add position: absolute to your Facebook button. Header.php <div class="logo"> <a class="logoimga" title="Gelnagels Gina" href="http://www.gelnagels-gina.be/"> <img src="http://www.gelnagels-gina.be/wp-content/uploads/2015/04/Gina4.png"> </a> <a class="header-img-1" title="Facebook-header" href="#"> <...


1

Since you've designated a specific page to be your Post Archive ( blog ) it no longer is a standard page; meaning is_page() will likely fail. Since your blog page is now more of an archive, it is automatically being returned because of your first conditional. is_singular() - Returns true when viewing a single page, post, or post type. So what you're ...


1

The easiest way to get the URL for the thumbnail would be: <?php echo MultiPostThumbnails::get_post_thumbnail_url(get_post_type(), 'header-image', $post->ID); ?>


1

found the solution: <div class="fill" style="background-image:url('<?php $custom = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'header-image', $post->ID); $custom=wp_get_attachment_image_src($custom,'header image'); echo $custom[0]; ?>');"></div>


1

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' =>...


1

Try to replace if ( $url !== 'http://www.mydomain.net/' ) with if ( !is_home() ), which is WP's own function that checks if it's the blog's front page.


1

I got it! <?php if ( (is_home()) || (is_single()) ) { ?> <?php echo theme_heading(); ?> <?php } elseif (is_page()) { ?> <img src="<?php echo get_stylesheet_directory_uri() ?>/images/logopage.png" /> <?php } ?> Thanks to everyone!


1

This doesn't have much to do with Genesis, other than you need to hook into the header in one of several ways, with Simple Hooks http://wordpress.org/plugins/genesis-simple-hooks/ or in functions.php. I'll leave that to you. But using <?php echo qtrans_getLanguage(); ?> do something like this: $currentLang = qtrans_getLanguage(); if($currentLang ==...


1

You could add a custom field to the pages with the value being your image path and then code that variable in the header.php of your child theme. Check out get_post_meta It might look something like this if the field name was headerImage. $headerImage = get_post_meta( get_the_ID(), $headerImage, true ); get_the_ID grabs the current post or page ID.


Only top voted, non community-wiki answers of a minimum length are eligible