• I wanna make header media image also a link, like if clicked it should lead to main page

    Any help with how?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,
    Currently, Zakra doesn’t have the option to make header media clickable. However, you can achieve by creating a child theme and write code to override the hook function to achieve the same.

    Please let us know if you need help with that. 🙂

    Thanks.

    Thread Starter ubicray

    (@ubicray)

    Yes, I’d really appreciate the help with that 🙂

    Firstly, you need to create a child theme for Zakra theme or simply download it from the list here: https://themegrill.com/blog/tutorial-creating-wordpress-child-theme/

    From the child theme’s folder edit functions.php file and add the following code at the end of the file:

    if ( ! function_exists( 'zakra_header_media_markup' ) ) :
    	/**
    	 * Header media tag.
    	 */
    	function zakra_header_media_markup() {
    
    		$output  = '';
    		$output  = '<div id="wp-custom-header" class="wp-custom-header">';
    
    		$output .= '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" rel="home">';
    			$output .= '<img src="' . esc_url( get_header_image() ) . '" width="' . get_custom_header()->width . '" height="' . get_custom_header()->height . '" alt="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '">';
    		$output .= '</a>';
    		$output .= '</div>';
    
    		echo $output;
    
    	}
    endif;

    Then, install and activate the child theme.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Make header media image a link’ is closed to new replies.