• Resolved ladylorien

    (@ladylorien)


    I’m using an image in Flash’s Header Media. I want to make the image clickable and link to my homepage. I have a child theme, but I haven’t been able to figure out what code to add to achieve this. Any ideas?

    Thanks!

    • This topic was modified 4 years, 10 months ago by ladylorien.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @ladylorien,

    To get the result as you desired, you must activate the child theme. You can get knowledge about the child theme and download the flash child theme from the below link.
    https://themegrill.com/blog/tutorial-creating-wordpress-child-theme/
    After download, make a folder named template-parts inside the flash-child folder you have downloaded and locate header-media.php from parent theme folder i.e flash and copy it to template-parts that you have created and then edit the header-media.php that you have copied and change this code the_custom_header_markup(); to flash_the_custom_header_markup();. Then locate functions.php in flash-child folder and edit it. Then, at the end of the line add the following codes:

    
    function flash_get_custom_header_markup() {
    	if ( ! has_custom_header() && ! is_customize_preview() ) {
    		return '';
    	}
    	return sprintf(
    		'<div id="wp-custom-header" class="wp-custom-header"><a href="' . get_bloginfo('url') . '">%s</a></div>',
    		get_header_image_tag()
    	);
    }
    function flash_the_custom_header_markup() {
    	$custom_header = flash_get_custom_header_markup();
    	if ( empty( $custom_header ) ) {
    		return;
    	}
    	echo $custom_header;
    	if ( is_header_video_active() && ( has_header_video() || is_customize_preview() ) ) {
    		wp_enqueue_script( 'wp-custom-header' );
    		wp_localize_script( 'wp-custom-header', '_wpCustomHeaderSettings', get_header_video_settings() );
    	}
    }
    

    Then, install and activate the child theme.

    Thanks,
    Ashesh

    • This reply was modified 4 years, 10 months ago by Ashesh Magar.
    • This reply was modified 4 years, 10 months ago by Ashesh Magar.
    Thread Starter ladylorien

    (@ladylorien)

    Great, thank you so much!

    Glad I could help ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Clickable Header Media’ is closed to new replies.