Search code examples
htmlcsswordpressheaderfixed

Fixed Header in Wordpress + Static Lines


I'm creating this site using the dazzling theme and everything seems to work fine except the header.

Have added these code lines to my css and it works fine for the homepage as you can see.

position: fixed;
z-index: 99;
width: 100%;

However, when you visit any other page or blog post, the header is messed up. Can you please provide a solution.

Another problem is, on the home page carousal, I need to add a few more lines to the blog excerpt (Art brings faith to life. This blog....). Can it be done via CSS?

Solved both the problems:

  1. Adding a single line top:0; did the trick. Thanks to the community for helping out.
  2. It seems, the problem was with the default WP excerpt which is 55. Used a single function in the functions.php file which did the trick. Have mentioned it below if it might be a help for others.

    /* New excerpt length of 120 words*/
    function my_excerpt_length($length) {
    return 70;
    }
    add_filter('excerpt_length', 'my_excerpt_length');
    

You can change the 70 to anything you like :)


Solution

  • For your first problem The menu having the problem because you set margin-top for your content id.

    Keep this as it is if you need to have, make change in you css

    style.css line 612

    you have to

    .navbar.navbar-default
    {
    leave other css as it is and change only
    position: fixed;
    top: 0; /* This one you miss*/
    and remove margin
    }
    

    For second thing you can increase the width or give height to your blog excerpt div. in flexslider.css at line 98