Find Answers and Get Support › Forums › Gorgo – Multi-Purpose Gutenberg Blog & Magazine Theme › Website Setup › Pages › Add image to header
- This topic has 3 replies, 2 voices, and was last updated 5 years, 7 months ago by
Themosaurusrex.
-
AuthorPosts
-
ArthurParticipant@asutaroto
- 2 Topics
- 4 Posts
How do I insert an image into the header of the post? Which file is this edited in? I tried to add an image using the ACF plugin, but failed.
Insertion code
<?php $image = get_field('image'); if( !empty($image) ): ?> <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /> <?php endif; ?>
Thank you in advance for your help.
August 13, 2019 at 20:29 #7529@themosaurusrex- 0 Topics
- 2048 Posts
Hi @asutaroto,
The custom header cannot be customize that way but you may consider using the
grimlock_breadcrumb
action to add markups inside the header safely.Simply add the following code snippet to your website:
/** * Display some image after the header title, subtitle and metadata. */ add_action( 'grimlock_breadcrumb', 'gorgo_custom_grimlock_breadcrumb', 20, 1 ); function gorgo_custom_grimlock_breadcrumb() { // Replace the following bit by your custom code. ?> <img src="http://placehold.it/200x200" alt="Your image"> <?php }
To add this code snippet to your site, we recommend that you use a the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). If you have never activated this plugin, please read the following post:
Please also note that we don’t provide any theme customization. So, you shouldn’t expect other snippets from us unless it’s to fix an issue or some kind of limitation stemming from our own codebase. We always try our best to help theme users whenever we can and usually only provide code snippets out of courtesy to prevent them from waiting for the next update.
Regards,
August 15, 2019 at 15:48 #7533@themosaurusrex- 0 Topics
- 2048 Posts
You’re welcome.
?
Best,
August 16, 2019 at 14:39 #7536 -
AuthorPosts
The topic ‘Add image to header’ is closed to new replies.