php - Wordpress 侧边栏与内容不对齐

标签 php jquery html css wordpress

这让我发疯,因为我不是代码高手,使用模板“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/

相关文章:

php - TinyMce 添加长 <div id="mouseposition... 标签

php - HTML 按钮不是每次都提交

javascript - 多个列表项的同级项

javascript - 使用 html5 本地存储显示值

html - 如何使图像在保持顺序的同时向右浮动

php - 我们如何计算 codeigniter 中的月销售额?

javascript - 如何根据另一个下拉选项更改下拉选项?从数据库检索的值

json - 将 json 对象发布到 MVC3 Controller , bool 值始终为 false

javascript - jQuery nuSelectable 插件

html - 了解 CSS 选择器优先级/特异性