Insert image in header

I would like to add an image to my header for all pages. How do I do it? What should I pay attention to regarding page speed and response?

Thank you very much for your support.

Ralf Kalus

Hello Ralf,

Thanks for writing in!

To accomplish what you have in mind, please do this:

  • Go to X > Global Blocks and create the header section with your text and banner image in it.
  • And then in your child theme’s functions.php file, add the following php code:
// For the header
function custom_image_header() {
	echo do_shortcode('[cs_gb id=123]');
}
add_action('x_before_view_global__slider-below', 'custom_image_header');

Just make sure that you add the correct global block shortcode. I added a temporary code: [cs_gb id=123]

We would loved to know if this has work for you. Thank you.

Thank you very much for the quick answer!
Sorry, I am not a professional. How do I get into the x > global blocks and how do I upload the picture?

A detailed instruction would be very helpful for me.

Thank you very much !

Hello @ratgeber,

Please go back to your WP Dashboard and you will find the X > Global Blocks link.

You can insert the image as a section background image which you will create as a global block. If you are not familiar with section and the Cornerstone builder, please check this out:

And to learn more about Global Blocks, please check this out:

Hope this helps.

Okay, as you can see, I don’t have this menu.
Thank you very much !

Hello Ralf,

It turns out that you are using an older version of the theme and Cornerstone. Could you please update to the latest versions?
Our latest versions are:

  • X theme 6.5.4
  • Cornerstone 3.5.3

This latest release contains fixes for several issues so be sure to check out the changelog (http://theme.co/changelog/).

_After doing the updates, always remember to clear all caches (if you are using WP Fastest Cache, WP Rocket, WP SuperCache or W3 Total Cache) when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors.-

Please let us know how it goes.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.