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 solved this install 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

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

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

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

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


2

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


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

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 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

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

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

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.


1

I don't see any hooks available to help you hook your function. As you are using child theming, so take the copy of the header.php file from the parent twenty thirteen theme and paste it in the child theme folder and make the changes. This will work.


1

You generally do it by installing an image slider plugin and then using the plugin options to do that for you. Most of such plugins come with the shortcode options only, and do not provide automatic slider addition to the other sections, so you have to do it manually. To add stuff manually, one should have the basic knowledge of editing WordPress themes. ...


1

You have done the most of it, just that you haven't realized it yet. If you are using a child theme then you can copy and paste the header.php from the main theme into the child theme folder and make the exact same changes you have made now to keep the icon above the logo. Now the header.php in child theme will load instead of the main theme's. In doing so ...


1

I managed to solve this without relying too much on creating new templates, by using JetPack plugin. And took advantage of it's ability to add Custom CSS This is the CSS line I added body.page .header-wrapper { background: #333; background-image: url(http://image-url/image.png); background-attachment: fixed; background-size: auto !...


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