这让我发疯,因为我不是代码高手,使用模板“submate”我试图在 child 主题优势上添加右侧边栏
<?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
//get the sidebar
$avia_config['currently_viewing'] = 'page';
if(is_front_page()) { $avia_config['currently_viewing'] = 'frontpage'; }
get_sidebar();
?>
<div class="breadcrumbs">
<?php if(function_exists('bcn_display'))
{
bcn_display();
}?>
</div>
<?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/
非常感谢您的帮助:)
最佳答案
您的文章 html 结构非常糟糕。您已将 article
元素包装在 strong
元素中,这没有意义,因为它用于使文本更粗。
无论如何,您都可以将这个小片段添加到您的 wp-content/themes/your-theme/style.css
article[class*="post"] { /* only post articles */
float: left;
width: 65%;
}
编辑
仅针对特定页面:
.page-id-231 article[class*="post"] { /* only post articles */
float: left;
width: 65%;
}
关于php - Wordpress 侧边栏与内容不对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22065449/