WordPress sidebar not align with content
它让我发疯,因为我不是代码高手,使用模板\\’submate\\’我试图在 children 主题优势上添加右侧边栏
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<?php
/** * This template displays full width pages with a page title. * * @package vantage * @since vantage 1.0 * @license GPL 2.0 * * Template Name: submate */ get_header(); ?> <?php <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( ‘content’, ‘page’ ); ?> <?php endwhile; // end of the loop. ?> <?php get_footer(); ?> |
它的链接是; http://www.seasonalharvest.co.uk/recipes/february/
非常感谢您的帮助:)
- 将文章向左浮动,并给它一个宽度。您可能也想摆脱文章周围的 3 级深度 标记。
您的文章的 html 结构非常糟糕。您已将 article 元素包裹在 strong 元素中,这没有意义,因为它用于使文本更粗。
无论如何,您都可以将这个小片段添加到您的 wp-content/themes/your-theme/style.css
1
2 3 4 |
article[class*=“post”] { /* only post articles */
float: left; width: 65%; } |
编辑
仅适用于特定页面:
1
2 3 4 |
.page–id–231 article[class*=“post”] { /* only post articles */
float: left; width: 65%; } |
- 谢谢你,它解决了问题,但是它使我所有其他页面文章的宽度
- @user3359955 您只需要特定页面吗?请参阅我的编辑答案。
试试这个…
1
2 3 4 5 6 |
<style type=“text/css”>
article#post-231 { float: left; width: 65%; } </style> |
来源:https://www.codenong.com/22065449/