html - WordPress sticky php side bar while scrolling up and down -
i using wordpress has right sidebar. want sticky while scrolling , down. have given css style. sticky now. but, problem shifting it's position right left.
here sidebar.php
<div class="sidebarsticky col-md-4"> <?php // select widgets include templatepath . '/assets/sidebar/search.php'; if ( is_home()) { // home page include abspath.'/wp-content/ads/300x600_side.php'; include templatepath . '/assets/sidebar/calendar.php'; include templatepath . '/assets/sidebar/featured.php'; include templatepath . '/assets/sidebar/fb.php'; include abspath.'/wp-content/ads/side_3rdparty.php'; include templatepath . '/assets/sidebar/comments.php'; include templatepath . '/assets/sidebar/newsletter.php'; include templatepath . '/assets/sidebar/popular.php'; } elseif ( is_single()) { // single page include abspath.'/wp-content/ads/300x600_side.php'; include templatepath . '/assets/sidebar/latest.php'; include templatepath . '/assets/sidebar/fb.php'; include abspath.'/wp-content/ads/side_3rdparty.php'; include templatepath . '/assets/sidebar/popular.php'; include templatepath . '/assets/sidebar/featured.php'; include templatepath . '/assets/sidebar/newsletter.php'; } elseif ( is_category()) { // category page include abspath.'/wp-content/ads/300x600_side.php'; include templatepath . '/assets/sidebar/latest.php'; include templatepath . '/assets/sidebar/fb.php'; include abspath.'/wp-content/ads/side_3rdparty.php'; include templatepath . '/assets/sidebar/featured.php'; include templatepath . '/assets/sidebar/newsletter.php'; } elseif ( is_tag()) { // tag page include abspath.'/wp-content/ads/300x600_side.php'; include templatepath . '/assets/sidebar/latest.php'; include templatepath . '/assets/sidebar/fb.php'; include abspath.'/wp-content/ads/side_3rdparty.php'; include templatepath . '/assets/sidebar/featured.php'; include templatepath . '/assets/sidebar/newsletter.php'; } elseif ( is_archive()) { // archive page include templatepath . '/assets/sidebar/calendar.php'; include abspath.'/wp-content/ads/300x600_side.php'; include templatepath . '/assets/sidebar/latest.php'; include templatepath . '/assets/sidebar/fb.php'; include templatepath . '/assets/sidebar/popular.php'; include templatepath . '/assets/sidebar/featured.php'; include abspath.'/wp-content/ads/side_3rdparty.php'; include templatepath . '/assets/sidebar/newsletter.php'; } elseif ( is_page('gsearch')) { // search page include abspath.'/wp-content/ads/300x600_side.php'; include templatepath . '/assets/sidebar/latest.php'; include abspath.'/wp-content/ads/side_3rdparty.php'; include templatepath . '/assets/sidebar/newsletter.php'; } else { // other pages include abspath.'/wp-content/ads/300x600_side.php'; include templatepath . '/assets/sidebar/calendar.php'; include templatepath . '/assets/sidebar/latest.php'; include templatepath . '/assets/sidebar/fb.php'; include abspath.'/wp-content/ads/side_3rdparty.php'; include templatepath . '/assets/sidebar/comments.php'; include templatepath . '/assets/sidebar/newsletter.php'; } // include templatepath . '/assets/sidebar/tabs.php'; ?> </div>
css style have used :-
.sidebarsticky { position: fixed; left: 0; top: 0; bottom: 0; overflow: auto; }
if want stick right side, change style to.
.sidebarsticky { position: fixed; right: 0; top: 0; bottom: 0; overflow: auto; }
left:0
force sidebar @ left rather right side of screen. right:0
out.
Comments
Post a Comment