how to make wordpress header image clickable
How to make wordpress header image clickable
Your WordPress theme most likely has a header. This header can display your navigation menu, social media icons, search bars, etc. Many WordPress themes, however, don’t come with a header that is clickable. Headers come in a variety of sizes and sometimes it makes it easier if a person clicks on the header to get back to the home page. This tutorial will show you how to make your header clickable by putting some simple php into your header file.
- Step 1: Find your header.php file in your wordpress theme folder which is located — wp-content/themes/yourtheme/header.php
- Step 2: Open your header.php file and locate this line — <header id=”header”>
- Step 3: Add this inside that line of code — onclick=”location.href='<?php echo get_settings(‘home’); ?>/’;” style=”cursor:pointer;”
- Step 4: The full line of code should now look like this — <header id=”header” onclick=”location.href='<?php echo get_settings(‘home’); ?>/’;” style=”cursor:pointer;”>
- Step 5: Save and exit the header.php file
Now your header file should be clickable and it will take you to the home page.