• Resolved lina78

    (@lina78)


    Hi! So I currently have a pin-it plugin installed. I love it; it works great, but I don’t like how it gives readers the option to pin my header. Any idea how I can fix this in the style sheet? I am using a pen scratch child theme.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Kathryn Presner

    (@zoonini)

    I don’t know how to prevent certain images from being pinned – perhaps that’s something you could ask in the plugin’s forum. If there’s a special class or tag that prevents pinning of an image with your specific plugin, you might be able to accomplish that in a child theme.

    Let me know how it goes.

    Thread Starter lina78

    (@lina78)

    <img src = “foo.jpg” nopin = “nopin” />
    This is the code that prevents an image from being pinned. I just don’t know where to put it. The child theme only lets me edit the CSS, how would I go about inserting that code into the HTML?

    Moderator Kathryn Presner

    (@zoonini)

    The child theme only lets me edit the CSS

    A child theme allows you to make all kinds of theme-file modifications, not just CSS, that’s one of its benefits over just using a custom CSS plugin. 🙂 Have a look at these guides to learn more:

    http://codex.wordpress.org/Child_Themes
    http://op111.net/53/
    http://vimeo.com/39023468

    So place a copy of header.php in your child theme, and edit line 40 from this:

    <img class="custom-header" src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">

    to this:

    <img class="custom-header" nopin = "nopin" src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="">

    That should do the trick – let me know how it goes.

    Moderator Kathryn Presner

    (@zoonini)

    I’m already seeing the nopin="nopin" code on your header image (and no Pinit button) – did you already figure this out?

    Thread Starter lina78

    (@lina78)

    Yes I was able to figure it out! I went into the actual theme’s HTML and fixed it there.

    Moderator Kathryn Presner

    (@zoonini)

    Great! I’d suggest you just move this change into your child theme, otherwise it’ll get overwritten every time you update the theme to the latest version. That’s one of the whole points of using a child theme, to protect changes from being erased when you update the theme. 🙂

    Thread Starter lina78

    (@lina78)

    I don’t see an option to edit the header.php in my child theme? That is why I didn’t do that before. Any idea why I am not seeing it in my child theme editor?

    Moderator Kathryn Presner

    (@zoonini)

    You need to make a copy of the file and place it in your child theme yourself. 🙂

    Thread Starter lina78

    (@lina78)

    Thank you for your help! I think for now I will leave it be {last time I tried to go into my site’s theme I completely crashed everything}. But again, I appreciate the advice!

    Moderator Kathryn Presner

    (@zoonini)

    Ha! OK. You’re actually safer not making changes in your parent (main) theme directly because you can always activate your parent theme if you mess up something in the child – that’s another benefit to child themes. 🙂 Let me know if you change your mind and I’m happy to walk you through it.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Taking Pin It button off of header’ is closed to new replies.