文章介绍
WordPress子比主题在保留侧边栏的前提下首页的主内容显示一行两篇文章,卡片一行显示4个,分类页面显示6个
效果展示图:
1.WordPress子比主题在保留侧边栏的前提下首页的主内容显示一行两篇文章(页面布局的宽度1500)

将下面的代码(删掉<style>和</style>)放到子比主题-全局功能-自定义css里,如果不生效就放到header.php和footer.php里(保留<style>和</style>)
<style>
@media (min-width: 1500px) {
  .posts-item {
    display: inline-flex;
    width: calc(50% - 16px);
  }
}
</style>2.WordPress子比主题在保留侧边栏的前提下让首页主内容,通过模块配置添加的多栏目文章小工具,显示卡片一行4个(页面布局的宽度1500)

将下面的代码(删掉<style>和</style>)放到子比主题-全局功能-自定义css里,如果不生效就放到header.php和footer.php里(保留<style>和</style>)
将下面的代码(删掉<style>和</style>)放到主题/子主题的自定义css里,如果不生效就放到header.php和footer.php里(保留<style>和</style>)
<style>
@media only screen and (min-width: 1500px){
.posts-item.card {
    width: calc(23.350% - -3px);
}
}
</style>2.WordPress子比主题在不保留侧边栏的前提下让首页和分类页面显示卡片一行6个(页面布局的宽度1500)

将下面的代码(删掉<style>和</style>)放到子比主题-全局功能-自定义css里,如果不生效就放到category.php里(保留<style>和</style>)
<style>
@media only screen and (min-width: 1500px){
.posts-item.card {
    width: calc(15.350% - -3px);
}
}
</style>3.WordPress子比主题在不保留侧边栏的前提下让首页和分类页面显示卡片一行5个(页面布局的宽度1500)
将下面的代码(删掉<style>和</style>)放到主题/子主题的自定义css里,如果不生效就放到header.php和footer.php里(保留<style>和</style>)
<style>
@media only screen and (min-width: 1500px){
.posts-item.card {
width: calc(18.700% - -3px);
}
}
</style>4.WordPress子比主题在保留侧边栏的前提下让首页和分类页面显示卡片一行5个(页面布局的宽度1500)
将下面的代码(删掉<style>和</style>)放到主题/子主题的自定义css里,如果不生效就放到header.php和footer.php里(保留<style>和</style>)
<style>
<style>
@media only screen and (min-width: 1500px){
.posts-item.card {
    width: calc(18.350% - -3px);
}
}
</style>5.WordPress子比主题在保留侧边栏的前提下让首页和分类页面显示卡片一行4个(页面布局的宽度1200)
将下面的代码(删掉<style>和</style>)放到主题/子主题的自定义css里,如果不生效就放到header.php和footer.php里(保留<style>和</style>)
<style>
@media only screen and (min-width: 1200px){
.posts-item.card {
width: calc(22.660% - -3px);
}
}
</style>



![【不忘初心游戏版】Windows11 LTSC2024 24H2 26100.2605 X64无更新 [精简版][2.4G](2024.12.20)推荐用于 游戏、办公、直播-52758绿软宝库](https://cos.52758.cn/images/2024/12/20241221123144568.jpg)


![【不忘初心美化版】[太阳谷] Windows7 旗舰版 专业版 SP1(7601. 27467)IE8 IE11 X64 [精简版][2.08G]-52758绿软宝库](https://cos.52758.cn/images/2024/12/20241221123348766.jpg)




请登录后查看评论内容