修复了Wordpress +静态行中的标题

时间:2021-01-08 11:43:22

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.

已将这些代码行添加到我的CSS中,如您所见,它适用于主页。

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?

另一个问题是,在主页carousal上,我需要在博客摘录中添加更多行(艺术带来信仰生活。这个博客......)。可以通过CSS完成吗?

Solved both the problems:

解决了这两个问题:

  1. Adding a single line top:0; did the trick. Thanks to the community for helping out.
  2. 添加单行顶部:0;做了伎俩。感谢社区的帮助。

  3. 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.

    看来,问题在于默认的WP摘录是55.在functions.php文件中使用了一个函数来完成这个技巧。如果它可能对其他人有帮助,请在下面提到它。

    /* 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 :)

您可以将70更改为您喜欢的任何内容:)

2 个解决方案

#1


2  

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

对于您的第一个问题菜单出现问题,因为您为内容ID设置了margin-top。

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

如果您需要,请保持原样,在您的css中进行更改

style.css line 612

style.css第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

第二件事,你可以增加你的博客excerpt div的宽度或高度。在第98行的flexslider.css中

#2


0  

just add top:0 in this css rule .navbar.navbar-default

只需在此css规则中添加top:0 .navbar.navbar-default

.

navbar.navbar-default {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 200;
    margin-bottom: 0;
    margin-top: -2px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 99;
}

#1


2  

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

对于您的第一个问题菜单出现问题,因为您为内容ID设置了margin-top。

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

如果您需要,请保持原样,在您的css中进行更改

style.css line 612

style.css第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

第二件事,你可以增加你的博客excerpt div的宽度或高度。在第98行的flexslider.css中

#2


0  

just add top:0 in this css rule .navbar.navbar-default

只需在此css规则中添加top:0 .navbar.navbar-default

.

navbar.navbar-default {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 200;
    margin-bottom: 0;
    margin-top: -2px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 99;
}