[問題] wordpress兩欄變三欄
各位好,新手又來請教一些修改既有網頁的問題...
網站原本是兩欄式(主頁面+右側邊欄)
但老闆希望可以改成三欄(左側邊欄+主頁面+右側邊欄)
拜谷歌大神之賜我已經成功修改好function、sidebar跟模版的php檔
WP後台的小工具那邊也出現新的一欄可以編輯
問題來了,新的那欄位置是在既有舊右側欄的下面
┌┐┌──┐┌┐ ┌───┐┌┐
│││ │││ │ │││
│││ │││ │ │││
└┘└──┘└┘ └───┘└┘
想要的格式 變這樣 ┌┐←新增的側邊欄跑到這裡QQ
└┘
找來找去不知道該如何把它變成在主頁左側
還希望高手板友們相助!!!謝謝~~~QAQ
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.176.135.12
※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1526229706.A.53B.html
推
05/14 08:20,
7年前
, 1F
05/14 08:20, 1F
→
05/14 08:22,
7年前
, 2F
05/14 08:22, 2F
CSS的寬度已經改好了!但還是一樣QAQ
請問html這裡可以麻煩再多說明一下嗎?@@
網路上的教學都說改好function.兩個php檔和CSS就好了
這個部分我完全沒概念,也不知道要去哪裡新增html..(淚)
※ 編輯: yangsen06 (180.176.135.12), 05/14/2018 22:52:22
推
05/14 22:53,
7年前
, 3F
05/14 22:53, 3F
好的!謝謝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
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章