推 nottt: 看三塊要的寬度分別想要多少,決定好後去改css 05/14 08:20
→ nottt: 同時,新增的html必須要是從左到右依序排好的 05/14 08:22
CSS的寬度已經改好了!但還是一樣QAQ
請問html這裡可以麻煩再多說明一下嗎?@@
網路上的教學都說改好function.兩個php檔和CSS就好了
這個部分我完全沒概念,也不知道要去哪裡新增html..(淚)
※ 編輯: yangsen06 (180.176.135.12), 05/14/2018 22:52:22
推 nottt: 把你的東西貼上來大家會比較有興趣看喔 隔空抓藥很困難 05/14 22:53
好的!謝謝n大~~
這是function修改的部分:
function twentythirteen_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Widget Area', 'twentythirteen' )
'id' => 'sidebar-1',
'description' => __( 'Appears in the footer section of the site.', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">'
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Secondary Widget Area', 'twentythirteen' ),
'id' => 'sidebar-2',
'description' => __( 'Appears on posts and pages in the sidebar.', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Secondary Widget Area', 'twentythirteen' ),
'id' => 'sidebar-3',
'description' => __( 'Appears on posts and pages in the sidebar.', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
-----------------下面是sidebar.php檔:-------------------
if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
<div id="tertiary" class="sidebar-container" role="complementary">
<div class="sidebar-inner">
<div class="widget-area">
<?php dynamic_sidebar( 'sidebar-2' ); ?>
</div><!-- .widget-area -->
</div><!-- .sidebar-inner -->
</div><!-- #tertiary -->
<?php endif; ?>
<?php
if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
<div id="third" class="sidebar-container" role="complementary">
<div class="sidebar-inner">
<div class="widget-area">
<?php dynamic_sidebar( 'sidebar-3' ); ?>
</div><!-- .widget-area -->
</div><!-- .sidebar-inner -->
</div><!-- #tertiary -->
<?php endif; ?>
---------------------------網站模版的php檔:----------------------
<div class="widget-content">
<?php get_sidebar(); ?>
</div>
----------------------------CSS------------------------------------
.site-main .widget-area {
float: right;
/*width: 300px;*/
大概是這樣,跪求板友們指點教學!!!謝謝~~><
※ 編輯: yangsen06 (180.176.135.12), 05/15/2018 00:14:00