Reply To: Change Header Logo

Home Forums Support Change Header Logo Reply To: Change Header Logo

Home Forums Support Change Header Logo Reply To: Change Header Logo

#148039
bdbrown

You would follow the same process as above to add a custom field for the link:

1. In the “Custom Fields” metabox – click “Enter new”.

2. Under “Name”, add: custom_link

3. Under “Value”, enter your link URL

4. In GP Hooks, in the “Before Header Content” hook, change the code to this to wrap the image in an anchor tag:

<?php
global $post;
$image = get_post_meta($post->ID, 'custom_header', true);
$link = get_post_meta($post->ID, 'custom_link', true);
if ( ! empty( $image ) ) : ?>
      <a href="<?php echo $link; ?>"><img src="<?php echo $image; ?>" alt="" /></a>
<?php else : ?>
      <img src="URL TO MY DEFAULT LOGO" alt="" />
<?php endif; ?>