• Resolved Zythus

    (@zythus)


    As above, content area is overlapping Twitter widget on homepage. I want the widget to be on the right side, in it’s own div sidebar, and content area on the left, in it’s own div primary. Thing is, when primary overlaps widget, our widget doesn’t work.

    Using
    #primary {
    width: 75%; }
    In style.css solves it, but simultaneously changes the width on every other page, which I want to avoid.
    Following internet, I put is_home and is_front_page into that .css file, but It doesn’t read the code. Putting that code into index.php (which defines how homepage looks like) only shows it as a pure text on website.

    Any suggestions would be helpful ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Following internet, I put is_home and is_front_page into that .css file, but It doesn’t read the code. Putting that code into index.php (which defines how homepage looks like) only shows it as a pure text on website.

    Are you trying to use/enqueue that CSS only in the homepage? if so, add this to your active theme’s functions.php file:

    function add_my_custom_css() {
    	if(!is_home()) return false;
    	?>
    		<style type="text/css" media="all">
    			#primary {
    				width: 75%;
    			}
    		</style>
    	<?php
    }
    add_action('wp_head', 'add_my_custom_css');
    Thread Starter Zythus

    (@zythus)

    You’re a god dude. Thank you!

    Haha! I am glad to hear it worked for you!

    You’re welcome ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Content area overlapping Twitter widget on homepage’ is closed to new replies.