Wp ขยายเนื้อหา

เริ่มโดย miyakawa, 25 เมษายน 2013, 18:02:28

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

miyakawa



ต้องการขยายเนื้อหา อ่ะครับลองค้นหาและทำวิธีต่างแล้วไม่ได้อ่ะครับ  ตามรูปอ่ะครับ :wanwan017: :wanwan017:

Wdbox

ใช้ theme ของอะไรคะ

บาง theme สามารถแสดงผลให้เป็นแบบ full (no sidebar) ได้ค่ะ
รับงานเขียนบทความภาษาอังกฤษ/ภาษาไทย จ้างราคาดี มีงานคุณภาพตอบแทน

แนะนำเว็บสอน CSS แบบเบื้องต้นของแท้ (ปล.ไม่ใช่เว็บของเรา แต่เห็นว่ามีดี จึงเอามาแชร์กัน)
enjoyday | dwthai
[direct=http://www.boxanimemanga.blogspot.com]BoxAnimeManga[/direct]

wasantec

ลองเอาเว็บมาดูก่อนครับ ถึงจะแกะให้ได้นะ ลอยๆมาแบบนี้คงไม่ได้คำตอบ :P

aofiezzangz

ไปปรับส่วนของ css ตรง content ขนาดเดิมน่าจะอยู่ประมาณ 700 กว่า ๆ ขยายให้เท่า head เลยครับ

amjack

อ้างถึงจาก: Wdbox ใน 25 เมษายน 2013, 18:04:42
ใช้ theme ของอะไรคะ

บาง theme สามารถแสดงผลให้เป็นแบบ full (no sidebar) ได้ค่ะ

ใช้แล้วครับ

miyakawa

ธีม thememagic ครับ หน้าแรก ไม่มีนะครับแต่ พวกเนื้อหามีหมด :wanwan017:

miyakawa

ขอบคุณทุกความเห็นครับตอนนี้ยังทำไม่ได้เลย  :wanwan017:

tctheworld

แก้ css ครับ ต้องทราบก่อนว่า div นั้นใช้ class อะไร

Serge

แก้ที่ทีมครับ แก้ในส่วนของ style.css และ single.php สองตัวนี้ต้องสัมพันธ์กันครับ  :wanwan044:
[direct=http://xn--12c3c0ac0cf5ac2j5d2a.com/]Herbraga[/direct] ผลิตภัณฑ์เสริมอาหาร เหมาะสำหรับผู้ที่รักสุขภาพ

chlorophill

#9
1. สร้าง Template ใหม่ขึ้นมา โดย Copy ไฟล์ page.php เพิ่มโค้ดลงไป เซฟชื่อใหม่(ของผมเซฟเป็น one-column-template.php) ไฟล์จะเป็นดังนี้

<?php
/*
Template Name: One column template
*/

get_header(); ?>


<!--content-->
<div id="content">

<div id="left-col">

<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

<div class="post-head">

<h1><?php the_title(); ?></h1>

</div><!--post-heading end-->

<div class="post-entry">

<?php the_content(); ?>
<div class="clear"></div>
<?php wp_link_pages( array( 'before' => '' __'Pages:''thememagic' ), 'after' => '' ) ); ?>

</div><!--post-entry end-->

<?php if(of_get_option('comment_page') != "off") { ?>
<?php comments_template''true ); ?>
<?php ?>


<?php endwhile; ?>
</div> <!--left-col end-->

<?php //get_sidebar(); ?>

</div> <!--content end-->

</div>
<!--wrapper end-->
<?php get_footer(); ?>


- ที่เพิ่มขึ้นมาคือส่วนหัว ---> Template Name: ชื่อเทมเพลท เพื่อบอกให้รู้ว่านี่เป็นเทมเพลทใหม่ ตั้งชื่อตามต้องการ ในที่นี้ผมตั้งเป็น One column template
- <?php //get_sidebar(); ?> ---> เอา sidebar ออก โดยผมเอาออกโดยการใส่ //


2. ไปที่ Appearance > Theme Options > Style Settings แล้วเพิ่มโค้ดลงไป หรือจะไปแก้ใน style.css ก็ได้

body.page-template-one-column-template-php #content {
        background: none; /* ลบเส้นแนวตั้ง */
}

body.page-template-one-column-template-php #content #left-col {
        width: 964px; /* ขยายให้เต็มพื้นที่ */
padding: 20px 11px 20px 10px;
margin: 0 auto;
z-index: 1;
}

body.page-template-one-column-template-php .post-entry {
        width: 964px; /* ขยายให้เต็มพื้นที่ */
float:left;
padding-bottom: 10px;
padding-top: 10px;
}



ไป edit page ที่ต้องการ เลือก Template เป็น One column template(หรือชื่อที่ท่านตั้งไว้) ก็จะได้เพจเต็มพื้นที่แบบไม่มี sidebar ครับ ผมลองดูแล้วได้นะ

Wdbox

อ้างถึงจาก: miyakawa ใน 25 เมษายน 2013, 18:02:28


ต้องการขยายเนื้อหา อ่ะครับลองค้นหาและทำวิธีต่างแล้วไม่ได้อ่ะครับ  ตามรูปอ่ะครับ :wanwan017: :wanwan017:

เวลาแก้ อย่าแก้ที่ theme โดยตรง   ให้โหลด child theme ของ thememagic มา แล้วแก้ใน child theme  เผื่อว่าถ้าคุณจะ update theme ขึ้นมา  ถ้าคุณไม่มี child theme แต่แก้โค้ดใน theme หลัก  ที่แก้ไปทั้งหมดจะถูก reset ใหม่หมด

รับงานเขียนบทความภาษาอังกฤษ/ภาษาไทย จ้างราคาดี มีงานคุณภาพตอบแทน

แนะนำเว็บสอน CSS แบบเบื้องต้นของแท้ (ปล.ไม่ใช่เว็บของเรา แต่เห็นว่ามีดี จึงเอามาแชร์กัน)
enjoyday | dwthai
[direct=http://www.boxanimemanga.blogspot.com]BoxAnimeManga[/direct]