• Resolved HelloImChase

    (@helloimchase)


    Hello,

    My sidebar is much longer than the content on my page when using a sidebar widget or two as you can see here (http://i.imgur.com/bB5YBDH.png), I am trying to shorten it. Using inspect element, I can shorten it’s length I want using this setting:

    <div class=”sidebar_increase theme_article” style=”height:1958px”></div>

    As you can see here: (http://i.imgur.com/1O5rgFo.png)

    However, I cannot find where this div class tag is actually located. If I could locate it, I could lower “height:1958px” and make it fit the correct size. Any help would be very appreciated.

    Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter HelloImChase

    (@helloimchase)

    If I could just change this:
    <div class=”sidebar_increase theme_article” style=”height:1958px”></div>

    To this:
    <div class=”sidebar_increase theme_article” style=”height:100%”></div>

    It would be perfect. Thanks!

    anonymized-13749270

    (@anonymized-13749270)

    Have you also tried some overflow:hidden and/or float: right ?

    The selector for that division can be:

    #sidebar_main .sidebar_increase

    You should also try max-height instead of height..

    Thread Starter HelloImChase

    (@helloimchase)

    Adding this:

    sidebar_main .sidebar_increase {
    height: 100%;
    overflow: hidden;
    }

    To CUSTOM CSS, fixes it EXCEPT when you reload the page. It will stay fixed if you browse the website, but if you ever push F5 or simply reload, the sidebar becomes really large again.

    I am not the developer of this theme, i am just trying to fix this issue that only happens when the sidebar has widgets in it. If I could simply find where this:

    <div class=”sidebar_increase theme_article” style=”height:1958px”></div>

    Is located, in what php file etc, I could fix this. But I have no idea where it is..

    anonymized-13749270

    (@anonymized-13749270)

    Is it alright if you link us to your website?

    https://codex.ww.wp.xz.cn/Forum_Welcome#Link_to_Your_Site

    Thread Starter HelloImChase

    (@helloimchase)

    I sent it to you, through your website, as I don’t want it public.

    anonymized-13749270

    (@anonymized-13749270)

    Thank you Chase!

    Now, tell me what you exactly want. because, when I add height:auto to the sidebar, it fades away. Is that what you want?

    Or, making it fit to the other posts in the left? I mean the height.

    thanks!

    Thread Starter HelloImChase

    (@helloimchase)

    YES! I want to change it to height:auto! But HOW, I know how to use inspect element, how do I ACTUALLY change it so it stays that way? Do you understand?

    Yes, I would LOVE if it was height:auto always, not just using inspect element until you refresh the page. Where do I edit that?

    Thank you =)

    anonymized-13749270

    (@anonymized-13749270)

    Oh. so that’s the deal.

    Here’s your custom CSS:

    #sidebar_main .sidebar_increase {
    	height: auto!important;
    }

    You can add it to custom css file (jetpack..) or via this plugin: http://ww.wp.xz.cn/plugins/simple-custom-css/, or by adding this to the end of theme functions file:

    function hide_increased_sidebar() {
    	?>
    		<style type="text/css" media="all">
    			#sidebar_main .sidebar_increase {
    				height: auto!important;
    			}
    		</style>
    	<?php
    }
    add_action('wp_head', 'hide_increased_sidebar');
    Thread Starter HelloImChase

    (@helloimchase)

    Thank You! =)

    Thread Starter HelloImChase

    (@helloimchase)

    Marking as resolved.

    anonymized-13749270

    (@anonymized-13749270)

    You are welcome. Glad to hear it worked.

    Have a nice day 🙂

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Limit sidebar length’ is closed to new replies.