variable created in page.php is null inside of header.php

Generally said, there should nothing be happening before the get_header() call. So initiate your class if is_page() is true via wp_head action hook. Example: add_action( ‘wp_head’, ‘initiate_my_class’ ); function initiate_my_class() { if ( is_page() ) { //code } } Edit: As @AndrewBartel in his comment said you can globalize your variable or implement some kind … Read more

Create image with imagepng() (fails at header)

You could try using get_template_directory() instead of ABSPATH. If wp-content is not in it’s original location on production server that might solve your problem. Mind the lack of trailing slash after get_template_directory(): $font = get_template_directory().’/ledboard.ttf’; … file_put_contents(get_template_directory().’/img/’.$arrayFuels[$i].’.png’, $data);

Magnific Popup – Add Caption to Images

You have to add the title attribute to the <a href> code surrounding the images that the Magnific Popup effect is being applied to. The new code should look like this: $thumb_img = get_post( get_post_thumbnail_id() ); // Get post by ID $excerpt = $thumb_img->post_excerpt; // Display Caption <a href=”https://wordpress.stackexchange.com/questions/178297/{current_url_here}” title=”<?php echo $excerpt; ?>” /> It … Read more