• Resolved justanotherpoet

    (@justanotherpoet)


    Greetings! I would like to unlink the header image on my site–that is, I do not want it to be “clickable”. Can somebody please tell me how to do this? Thank you. My site is: BurstingPlethora.com and I’m using the Suffusion theme. Thanks again.

Viewing 14 replies - 16 through 29 (of 29 total)
  • Well, for your child theme you can add following code in your functions.php at the end of file. This will insert the script tag in your header.php’s <head> tag.

    <?php
    add_action('wp_head', 'addCodeToHead');
    
    function addCodeToHead() {
    ?>
    <script type="text/javascript">
    $jq = jQuery.noConflict();
    $jq(document).ready(function() {
      $jq('#logo').unwrap('#link');
    });
    </script>
    <?php
    }
    ?>
    Thread Starter justanotherpoet

    (@justanotherpoet)

    @tirumal that didn’t work. I copied/pasted the above code into my child theme and it didn’t work.

    Thread Starter justanotherpoet

    (@justanotherpoet)

    @tirumal now, to be clear. When I first created the child theme for Suffusion, I only imported the style.css and not any php. Does this have any impact as to why the above code will not work?

    Sorry for the complications.

    Open header.php file and search for </head> tag.

    and insert the following code just above the </head> tag.
    (the code based on the file in pastebin as mentioned)

    <script type="text/javascript">
    	$jq = jQuery.noConflict();
    	$jq(document).ready(function() {
    	  $jq('.blogtitle a').removeAttr("href");
    	});
    </script>

    Now, your link shouldn’t work.

    Thread Starter justanotherpoet

    (@justanotherpoet)

    Yes, but I am using a child theme. Are you saying that I should insert this code into the header.php of the parent theme? And if so, should I insert it at the very end of the header file?

    Okay, for your child theme.

    Create a file called functions.php and insert the following code.

    <?php
    add_action('wp_head', 'addCodeToHead');
    
    function addCodeToHead() {
    ?>
    <script type="text/javascript">
    	$jq = jQuery.noConflict();
    	$jq(document).ready(function() {
    	  $jq('.blogtitle a').removeAttr("href");
    	});
    </script>
    <?php
    }
    ?>

    This should work…..

    Thread Starter justanotherpoet

    (@justanotherpoet)

    Okay. I have already, just a few minutes ago, imported the functions.php of the parent theme into the child theme. Now, being as though I have already made that import, can I just insert the above code into actions.php?

    Thread Starter justanotherpoet

    (@justanotherpoet)

    If I can insert it into actions.php, do I insert it at the very end of the file or somewhere else within the file?

    actions.php???

    It should be in functions.php . You need not import the functions.php from parent. You can create one more in child theme with the code what you want. It will attach to the parent functions.php

    Anywhere in the file will be okay. But, I recommend at the end of the file.

    Thread Starter justanotherpoet

    (@justanotherpoet)

    I’m confused. Sorry. I’m just gonna try out what I think you are saying and see how it works. Be right back.

    Thread Starter justanotherpoet

    (@justanotherpoet)

    Okay. It worked! You’re the man Tirumal!!!!!!!!!!!!! Thank you!!!!!!!!!! What I just did was:
    *went into my hosting cpanel
    *deleted the function.php file I had previously imported from parent theme
    *created a new function.php file
    *went back to my site, then into the theme editor
    *then inserted your code into the new function.php file

    Now, I have one last question for you. In the future, if I need to add/edit more functions, I can just do it through the new function.php file I created for the child theme, correct?

    It’s my pleasure to help you!!

    Yes, you can edit your new functions.php in child theme to make any changes to the site. And, to correct you it’s ‘functions.php’ not ‘function.php’.

    Thread Starter justanotherpoet

    (@justanotherpoet)

    Okay. Thanks. Thanks to all who contributed. Gonna go ahead and mark this as resolved.

Viewing 14 replies - 16 through 29 (of 29 total)
  • The topic ‘Unlink Header Image?’ is closed to new replies.