WordPress.org

Forums

[resolved] (sidebar image size) .PHP or .CSS code? (12 posts)

  1. craignimbusits
    Member
    Posted 2 years ago #

    Hi all,

    http://www.nimbus-its.co.uk - twenty eleven child

    I've got myself a bit confused. I've got a child theme running and I wanted to change the width of an image I have in my sidebar. I used firebug to find the code by highlighting the area. I thought I would just change the below code and paste it where it should be but I can't find the original code to know where to put it. Can I just paste it into the child? if so where?

    I'm newish so I don't know if its style.css or sidebar.php . or if its necessary to edit the plugin code.

    <aside id="black-studio-tinymce-6" class="widget widget_black_studio_tinymce">
    <div class="textwidget">
    <p>
    <a href="http://www.nimbus-its.co.uk/wp-content/uploads/2013/03/wt8.11.png">
    <img class="aligncenter size-full wp-image-304" width="513" height="837" src="http://www.nimbus-its.co.uk/wp-content/uploads/2013/03/wt8.11.png" alt="wt8.1">
    </a>
    </p>
    </div>
    </aside>

    thanks in advance
    Craig

  2. Andrew
    Forum moderator
    Posted 2 years ago #

    I thought I would just change the below code and paste it where it should be but I can't find the original code to know where to put it.

    I don't understand this, can you not create a new style with the CSS width you want?

  3. craignimbusits
    Member
    Posted 2 years ago #

    Maybe, I was just looking for the easiest way to do it. In the past I would just find the code which related to my problem and change it but if its easier to do it in the css file I'll do that.

    I got that using firebug, my problem is that I don't know where to find it or what file it will be in.

    I'm not very advance and I'm not competent enough to write my own code so I might struggle writing it in the style.css file

    thanks

  4. Andrew
    Forum moderator
    Posted 2 years ago #

    Are you sure it's not in Firebug?
    I used Google Chrome's equivalent tool and found it [screenshot].

  5. craignimbusits
    Member
    Posted 2 years ago #

    I don't want to sound like an idiot but if I wanted to make that image wider how would I go about it?

    I wanted to simply edit the code but I don't know what file I would find the relevant code.

  6. Andrew
    Forum moderator
    Posted 2 years ago #

    You'd have to expand the width of the element constraining it.
    It's not the image that has the constrain here, it's the width of one of its parent <div>s.

  7. craignimbusits
    Member
    Posted 2 years ago #

    Thanks for the input. Perhaps a little too advanced for me because it doesn't help. thanks though.

    I know the image size doesn't decide the width. What I wanted to know was where I can modify it. Its late I think I'll sleep on it

  8. Andrew
    Forum moderator
    Posted 2 years ago #

    Your queries may be better suited to a forum like http://csscreator.com/forum

  9. craignimbusits
    Member
    Posted 2 years ago #

    Thanks for the suggest - not necessary though it was, as I thought, very very simple fix (perhaps I didn't explain it, or you didn't understand)

    If anyone else want to increase the side of images in the side bar the easiest way is to increase the size of the sidebar!

    just added this into my style.css

    .left-sidebar #primary {
        float: right;
        margin: 0 0 0 -31.4%;
        width: 100%;
    }
    .left-sidebar #content {
        margin: 0 7.6% 0 34%;
        width: 53.4%;
    }
    .left-sidebar #secondary {
        float: left;
        margin-left: 7.6%;
        margin-right: 0;
        width: 23.8%;
    }

    With thanks to http://zeaks.org/

  10. Andrew
    Forum moderator
    Posted 2 years ago #

    You explained well and I understood it, I just didn't want to write the CSS for you.

  11. Just looking at your site and I can see the confusion. Your image is already as wide as the sidebar. It can't just be wider. If you want to change the width of the image in the sidebar, you'll need to change the width of the sidebar.

    Andrew's point is valid. You'll have to modify the CSS of:

    .left-sidebar #primary {
        float: right;
        margin: 0 0 0 -31.4%;
        width: 100%;
    }
    .left-sidebar #content {
        margin: 0 7.6% 0 34%;
        width: 53.4%;
    }
    .left-sidebar #secondary {
        float: left;
        margin-left: 7.6%;
        margin-right: 0;
        width: 23.8%;
    }

    Unfortunately, because this theme is responsive, the widths are in percentages and a bit more complicated, but you just need to play with these values.

    Personally, I think your sidebar is wide enough.

  12. craignimbusits
    Member
    Posted 2 years ago #

    Thanks,

    I changed it earlier. the sidebar is as I want it.

    It was me who posted the above code. Yesterday the image was too small, not now.

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic