Change header image loaded by jQuery to use HTTPS

Have you considered Protocol Rewriting? The code below will convert all http: and https: to // for each script, link, base, and image. Place this in your functions.php: add_action( ‘plugins_loaded’, ‘wpse_232287_init’ ); function wpse_232287_init() { // Initiate the function ob_start( ‘wpse_232287_remove_http’ ); } function wpse_232287_remove_http( $buffer ) { // Check for a Content-Type header, only … 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 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

Display different header images based on current page

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 … Read more

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( $page ) ) { $page = get_post( $page ); } elseif( is_null( $page ) ) { $page = isset( $GLOBALS[‘post’] ) ? $GLOBALS[‘post’] : NULL; } … Read more

“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 your provider to see if Imagick and/or GD are installed. You can also add this little snippet of code in your functions.php … Read more