WordPress.org

Support

Support » Themes and Templates » raindrops » [Resolved] Header image link?

[Resolved] Header image link?

  • Hi! I would like to change the link in the header image. Right now when I click on the image, it sends me to the homepage. What I would like it to do is to send me to another page on my site. Any help is appreciated.

    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Also, how can I make the link appear only on a specific area of the header image? I have a banner image and I would like to add the link just on the right side of the banner. Thanks!

    Theme Author nobita

    @nobita

    Hi oppetn

    Please open header.php line:76

    if ( true == $raindrops_link_unique_text ) {
    
    			echo raindrops_header_image( 'elements' );
    		} else {
    
    			echo raindrops_header_image( 'home_url' );
    		}

    above codes commentout and add script.

    for example

    /*		if ( true == $raindrops_link_unique_text ) {
    
    			echo raindrops_header_image( 'elements' );
    		} else {
    
    			echo raindrops_header_image( 'home_url' );
    		}
    */
    		$linked_header_image = '<a href="%2$s">%1$s</a>';
    
    		if ( is_home() or is_front_page() ) { // link to another page when home
    
    			$link_to = 'http://your website url 1/';
    		} elseif ( is_category() ) { // link to another page when category archives
    
    			$link_to = 'http://your website url 2/';
    		}
    
    		if ( ! is_tag() ) { //Header image Not Shown when tag archives
    
    			printf( $linked_header_image, raindrops_header_image( 'elements' ), $link_to );
    		}

    Thank you.

    Thanks Nobita. I’m a bit confused. I added the code, and now when I’m on the home page, the header image links to the page I wanted it to link to. But when I’m on another page and click on the header image it does nothing? Is there a way to add another smaller header image on top of the normal header image and have it link to another page when the original header image links to the home page?

    Thanks.

    Theme Author nobita

    @nobita

    If you needs default link for example.

    if ( is_home() or is_front_page() ) { // link to another page when home
    
    			$link_to = 'http://your website url 1/';
    } elseif ( is_category() ) { // link to another page when category archives
    
    			$link_to = 'http://your website url 2/';
    } else {// default link
                  		$link_to = 'http://your website url default/';
    }

    Is there a way to add another smaller header image on top of the normal header image and have it link to another page when the original header image links to the home page?

    I do not know whether or not like, but please try if good

    header.php

    /*		if ( true == $raindrops_link_unique_text ) {
    
    			echo raindrops_header_image( 'elements' );
    		} else {
    
    			echo raindrops_header_image( 'home_url' );
    		}*/
    
    		echo raindrops_header_image( 'elements' );

    and

    add functions.php first line <?php before below codes.

    add_filter( 'raindrops_header_image_contents', 'my_custom_header_image_content' );
    
    function my_custom_header_image_content( $content ){
    
    return '<a style="border-radius: 50px;-moz-border-radius: 50px;-webkit-border-radius: 50px;border: 0px solid #800000;width: 100px;height: 100px;background: orange;display: table;text-align: center;margin: 28px 0;margin-left:20px;" href="http://www.tenman.info/wp3/raindrops/"><span style="display: table-cell;vertical-align: middle;text-align: center;color: #fff;font-weight: bold;font-size: 28px;">♠</span></a>';
    }

    When I added the lower code in to the first line of functions.php my site wont show anything at all. I did it like this:

    <?php

    add_filter( ‘raindrops_header_image_contents’, ‘my_custom_header_image_content’ );

    function my_custom_header_image_content( $content ){

    return ‘<span style=”display: table-cell;vertical-align: middle;text-align: center;color: #fff;font-weight: bold;font-size: 28px;”>♠</span>‘;
    }

    Edit: I took the ” */ ” symbols off the header.php code you provided me with. Now it does something. I now have two of my original header images on top of eachother, but they are not showing as complete images, but as two halves of images. I don’t know if it has something to do with the changes I made to the style.css to hide the empty space above the header image

    #header-image{
    position:relative;
    overflow:hidden;
    margin-top: -100px;

    So what should I do?

    Thanks for the help!

    Theme Author nobita

    @nobita

    When I added the lower code in to the first line of functions.php my site wont show anything at all. I did it like this:

    If success shows below

    http://www.tenman.info/wp3/raindrops/files/header-image-content.jpg

    orange area can linked your own url.

    Did you make changes in the header template?

    I now have two of my original header images

    below function must use once

    raindrops_header_image( 'elements' )
    or
    raindrops_header_image( 'home_url' )

    maybe you use above function twice.

    Theme Author nobita

    @nobita

    Sorry oppetn I’m mistake.

    filter raindrops_header_image_contents is not exists currrent versions raindrops.

    Raindrops version 1.147 contain, now reviewing.

    Okay. Is it maybe possible to put an iframe where the header image should be? So i would have no header image but an iframe instead?
    Also, how can I make the menubuttons align evenly on the whole page from left side to right side?

    Thanks for your help.

    Theme Author nobita

    @nobita

    I think in the header image, the use of the iframe, and is difficult.

    Header image is displayed as the background image of the div element.

    The div element, by javascript, control of size can be made dynamically, depending on the width of the browser.

    I think the header image, in order to evenly multiple menus, and please waiting for the next update, using raindrops_header_image_contents hook, the table element is to use a combination of links, and maybe do easy.

    Thank you.

    Theme Author nobita

    @nobita

    Since there is no reply 2 weeks, change to Resolved

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] Header image link?’ is closed to new replies.
Skip to toolbar