2017-04-01 4 views
-1

私はtwentyfifteenのテーマをここの図のような基本的なレイアウトに変更しようとしています:enter image description here ロゴと画​​像が上部にあり、サイドのメニュー上部バーの下にあります。私の試みは、ヘッダー内のbodyタグの開始位置にdivを直接追加して、配置が機能するかどうかを確認することでした。これは、表示されているが、私はそれが絵に似(になりたいようにそれは、サイドメニューの「押し下げ」しませんWordpressヘッダーの修正が行われました

これは私のheader.phpのです。

<!DOCTYPE html> 
<html <?php language_attributes(); ?> class="no-js"> 
<head> 
    <meta charset="<?php bloginfo('charset'); ?>"> 
    <meta name="viewport" content="width=device-width"> 
    <link rel="profile" href="http://gmpg.org/xfn/11"> 
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>"> 
    <!--[if lt IE 9]> 
    <script src="<?php echo esc_url(get_template_directory_uri()); ?>/js/html5.js"></script> 
    <![endif]--> 
    <?php wp_head(); ?> 
</head> 

<body <?php body_class(); ?>> 
<div style="background-color: black; width: 100%; height: 100px;"></div> 
<div id="page" class="hfeed site"> 
    <a class="skip-link screen-reader-text" href="#content"><?php _e('Skip to content', 'twentyfifteen'); ?></a> 

    <div id="sidebar" class="sidebar"> 
     <header id="masthead" class="site-header" role="banner"> 
      <div class="site-branding"> 
       <?php 
        twentyfifteen_the_custom_logo(); 

        if (is_front_page() && is_home()) : ?> 
         <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1> 
        <?php else : ?> 
         <p class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></p> 
        <?php endif; 

        $description = get_bloginfo('description', 'display'); 
        if ($description || is_customize_preview()) : ?> 
         <p class="site-description"><?php echo $description; ?></p> 
        <?php endif; 
       ?> 
       <button class="secondary-toggle"><?php _e('Menu and widgets', 'twentyfifteen'); ?></button> 
      </div><!-- .site-branding --> 
     </header><!-- .site-header --> 

     <?php get_sidebar(); ?> 
    </div><!-- .sidebar --> 

    <div id="content" class="site-content"> 

それが関連している場合私はまた、テーマのスタイルシートhereを添付

を私の修正では、これはdiv要素が現れるかである:。。 enter image description here

黒いバーは、左のメニューの上にあることと、それを押し下げなければならない

答えて

0

サイドバーのdivの前にdivを作成しましたが、サイドバーdivの前に別のdivを作成して、サイドバーのdivの前に別のdivを挿入しているためです。

+0

私はまた、問題である可能性のある矛盾するCSS(絶対位置、左揃え)を見つけることができません。 –

関連する問題