3
votes
"There has been an error cropping your image" when cropping image
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
3
votes
"There has been an error cropping your image" when cropping image
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 ...
3
votes
How do I change the header image height in Twenty Seventeen?
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) ...
3
votes
Accepted
Featured Image Inherited from Parent Page
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( $...
3
votes
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',
);
...
2
votes
header_image not returning header image url
As @Michael says, header_image() returns the URL, you need to echo it:
<img src="<?php echo esc_url( header_image() ) ?>" ...
2
votes
How do I change the header image height in Twenty Seventeen?
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
votes
Accepted
Set a featured image as a replacement to the header image
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 ...
2
votes
Is it possible to take over a WordPress site if the old administrator is MIA?
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/...
2
votes
Accepted
Header background image just stopped working
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("....
2
votes
Accepted
header_image() with CSS
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(); ?>)"&...
1
vote
Changing Header scroll height for Twenty Seventeen theme on ALL pages
from that question you mentioned, this is the code:
.twentyseventeen-front-page.has-header-image .custom-header-media,
.twentyseventeen-front-page.has-header-video .custom-header-media,
.home.blog....
1
vote
Accepted
How Change Wordpress header image from admin menu
To be honest I don't fully understand why you need this custom code to upload images, it should be possible with the default settings.
To answer your question:
If you dig a bit through the code, you'...
1
vote
Accepted
Add more then one site logo - custom-logo theme support
I think you might be looking for something like this:
add_theme_support( 'custom-logo', array(
'height' => 480,
'width' => 720,
) );
You could also go with:
add_theme_support( 'custom-...
1
vote
Accepted
Change position of header image with default 2019 theme
In the header file for the child theme there is a div with class of "site-branding-container"
It contains an h1 element and a p element. Just ad an img element after the p element. i.e.
<div ...
1
vote
Accepted
How to get the Page featured image, not the Post featured image
You might be able to do this by calling wp_reset_postdata(); otherwise you will need to get the blog page ID and set that on the line before instead:
if ( is_home() ) {$post_id = get_option( '...
1
vote
Want to make header and footer CMS driven sothat Editors can modify its content from wordpress admin section
You can add an "options" page to the WP admin with this snippet, add it to your functions file.
// acf options page
if( function_exists('acf_add_options_page') ) {
$option_page = ...
1
vote
Accepted
get_header_image() causes "Prioritize visible content" issue in Page Speed Insights
I came across this question while having a similar issue with a few of my sites and confirmed, as you did, that the logo above the fold was the issue in each case. I am not using get_header_image() ...
1
vote
How do I change the header image height in Twenty Seventeen?
Stole from this site
This additional/custom CSS worked for me :
/*Computer screen */
@media screen and (min-width: 48em) {
.twentyseventeen-front-page.has-header-image .custom-header-image {
/*...
1
vote
How do I change the header image height in Twenty Seventeen?
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 ...
1
vote
Accepted
From where the header-text can be changed in WordPress custom header?
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 ...
1
vote
Accepted
Insert Facebook button into header
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 ...
1
vote
Accepted
Banner appearing on Pages but not Posts; call it conditional confusion
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 ...
1
vote
Multiple post image, echo url (path of image)
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
vote
Multiple post image, echo url (path of image)
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=...
1
vote
Replace header image on all other pages but home - URL issue
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
vote
Different header image 'Home' and Pages
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() ?&...
1
vote
Accepted
How would I go about adding custom header images per category?
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 ...
1
vote
Adding an image slider in the header of my site
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
header-image × 78custom-header × 15
headers × 11
theme-development × 9
images × 9
css × 7
themes × 6
php × 5
post-thumbnails × 4
theme-customizer × 4
logo × 4
theme-twenty-eleven × 4
functions × 3
customization × 3
child-theme × 3
theme-twenty-seventeen × 3
theme-twenty-thirteen × 3
plugins × 2
posts × 2
pages × 2
options × 2
responsive × 2
retina × 2
categories × 1
woocommerce-offtopic × 1