[WP] จะทำหน้า intro ยังไงหรอครับ (ติดปัญหาเพราะ rewrite url)

เริ่มโดย Normaderm, 21 ธันวาคม 2009, 04:08:30

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

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

Normaderm

คือถ้าไม่ใช่เว็บอื่น ผมก็ทำแบบ

ให้หน้า intro เป็นไฟล์ index.html

พอเว็บเราก็เป็น index.php


แต่ wp นี่สิ ตรงรีไลท์มันตัด index.php ไปแล้ว ทำให้เข้าไม่ได้อะครับ



ถ้างง ก็คือ

ผมจะทำหน้าอื่นมาเป็นหน้าแรกแทนหน้าอินเด็กของเวิดเพรสยังไงอ่ะครับ  ช่วยที แง่มๆ   :wanwan017:
[direct=https://www.facebook.com/aiunlockedvip]สอน AI[/direct]| [direct=https://aiunlock.co/]คอร์ส AI[/direct] | [direct=https://aiunlock.co/]สอน n8n[/direct]  | [direct=https://www.aiunlockinnovations.com/]สอน AI เชียงใหม่[/direct]

Meaw-IE

แต่ละ Post ตอนจะ Public มันมีให้ Sticky ได้ครับ อยากให้โพสไหนอยู่หน้าแรก ตลอดก็ไปปักหมุดมันคับ

กรณีของการใช้ Page เป็น Home ก็เข้าไป Setting ตั้งค่าหน้านั้นเปนหน้าแรกได้เช่นกันครับ
[direct=https://bait.rmutsb.ac.th/]คณะบริหารธุรกิจ[/direct] [direct=https://fea.rmutsb.ac.th/]คณะวิศวะฯ มทร.สุวรรณภูมิ[/direct] [direct=https://suphanburi.rmutsb.ac.th/]กบส สุพรรณบุรี[/direct]

ร้อยศพสยบแทบเท้า


มันมี plugin ที่ ทำให้ เป็น .html อยู่ครับ แต่ไม่รู้ใช้ได้ไหม

:P

ลอง หาธีมใหม่ ที่ออกแบบ มีหน้า Home น่าจะดีกว่า


Normaderm

อ้างถึงจาก: meaw-ie ใน 21 ธันวาคม 2009, 04:28:52
แต่ละ Post ตอนจะ Public มันมีให้ Sticky ได้ครับ อยากให้โพสไหนอยู่หน้าแรก ตลอดก็ไปปักหมุดมันคับ

กรณีของการใช้ Page เป็น Home ก็เข้าไป Setting ตั้งค่าหน้านั้นเปนหน้าแรกได้เช่นกันครับ

แง่ม ไม่ได้หมายถึงแบบนี้อ่ะครับ  :wanwan006:
[direct=https://www.facebook.com/aiunlockedvip]สอน AI[/direct]| [direct=https://aiunlock.co/]คอร์ส AI[/direct] | [direct=https://aiunlock.co/]สอน n8n[/direct]  | [direct=https://www.aiunlockinnovations.com/]สอน AI เชียงใหม่[/direct]

Normaderm

อ้างถึงจาก: ร้อยศพสยบแทบเท้า ใน 21 ธันวาคม 2009, 07:41:02

มันมี plugin ที่ ทำให้ เป็น .html อยู่ครับ แต่ไม่รู้ใช้ได้ไหม

:P

ลอง หาธีมใหม่ ที่ออกแบบ มีหน้า Home น่าจะดีกว่า



ตอนแรกก็คิดว่าถ้ามีหน้า Home นะจะลิ้งไป xxx.com/home.php  ได้ แต่ถ้าใช้ธีมใหม่็เท่ากับทำเว็บใหม่เลยอ่ะครับ  :P
[direct=https://www.facebook.com/aiunlockedvip]สอน AI[/direct]| [direct=https://aiunlock.co/]คอร์ส AI[/direct] | [direct=https://aiunlock.co/]สอน n8n[/direct]  | [direct=https://www.aiunlockinnovations.com/]สอน AI เชียงใหม่[/direct]

p1i3c1h

รู้สึก Drupal มี plugin "Frontpage" อยู่ในตัวเลยครับ

ส่วน WP ผมไม่รู้นะ
[direct=http://diarybe.com]My personal blog[/direct]

g-ji

สร้างไฟล์ใหม่ ตั้งชื่อว่า home.php

ข้างในไฟล์


<?php get_header(); ?>

<h1>This is Your Home</h1>

<?php get_footer(): ?>


แล้วอัพไปไว้ในธีมที่ใช้ อ้อ ดูธีมที่ใช้ดีๆ ก่อนนะว่ามันไม่ได้มีไฟล์ชื่อ home.php อยู่แล้ว  :P ถ้ามันไม่มีปัญหาเวลาเข้าเว็บไป มันจะขึ้น This is Your Home ตัวใหญ่ๆ นะ

wp_header() คือ ดึงไฟล์ header.php มาใช้
wp_footer คือ ดึงไฟล์ footer.php มาใช้

เท่ากับว่า ทำตัว content ของหน้า home อย่างเดียว หรือจะเขียนใหม่หมดเลยก็ได้ ไม่ต้องใช้ คำสั่งข้างบนทั้ง 2 อันเลยก็ได้ เอาไปลองใช้ดู

แก้ไขฟังก์ชันนิด จี้เบลอ - -*

select2web

เห็นพี่หรั่ง แกตอบมาอย่างนี้

kay, create the intro page and name it intro.html or index.html or whatever you want.html then open your .htaccess file and add:

DirectoryIndex intro.html index.php

This goes at the very top of the .htaccess file.

This will cause the server to load the first page in that list by default, then just simply link that file to the rest of your WP pages. or however you need it to work

ไม่รู้ใช้ได้ป่าวนะลองดู

ผมเคยทำทีหนึ่ง ที่นี่ http://www.na-nguabanphaeng.com/ แต่เป็นวิธีการแก้โค้ดซึ่งตรงไหน ผมกำลังหาอยู่ไว้เจอแล้วจะมาบอก
รับทำธีม smf,wordpress
[email protected]
บทความการเขียนโปรแกรม
select2web.com
บทความเวิร์ดเพรส
select2webstore.com

gigkokman

ถ้าผมเข้าใจคุณ Normaderm ถูก น่าจะไปตั้งค่าที่

Setting > Reading > Front page displays

แล้วก็เลือกว่าจะให้เป็นโพสล่าสุด หรือว่า static page ครับ
ลิขิตฟ้าหรือจะสู้มานะคน

Normaderm


อ้างถึงผมเคยทำทีหนึ่ง ที่นี่ http://www.na-nguabanphaeng.com/ แต่เป็นวิธีการแก้โค้ดซึ่งตรงไหน ผมกำลังหาอยู่ไว้เจอแล้วจะมาบอก


ใช่แล้วครับ ผมหมายถึงแบบนี้หล้ะ  :P

อ้างถึงจาก: g-ji ใน 21 ธันวาคม 2009, 12:10:00
สร้างไฟล์ใหม่ ตั้งชื่อว่า home.php

ข้างในไฟล์


<?php get_header(); ?>

<h1>This is Your Home</h1>

<?php get_footer(): ?>


แล้วอัพไปไว้ในธีมที่ใช้ อ้อ ดูธีมที่ใช้ดีๆ ก่อนนะว่ามันไม่ได้มีไฟล์ชื่อ home.php อยู่แล้ว  :P ถ้ามันไม่มีปัญหาเวลาเข้าเว็บไป มันจะขึ้น This is Your Home ตัวใหญ่ๆ นะ

wp_header() คือ ดึงไฟล์ header.php มาใช้
wp_footer คือ ดึงไฟล์ footer.php มาใช้

เท่ากับว่า ทำตัว content ของหน้า home อย่างเดียว หรือจะเขียนใหม่หมดเลยก็ได้ ไม่ต้องใช้ คำสั่งข้างบนทั้ง 2 อันเลยก็ได้ เอาไปลองใช้ดู

แก้ไขฟังก์ชันนิด จี้เบลอ - -*

อันนี้ผมเข้าใจถูกไหมครับ คุณจี้ คือให้ผมไปทำ อินโปร ในหน้า home.php แล้วไปเซ็ท home.php เป็นหน้าแรก ซึง
ถ้าตามที่ผมต้องการ คือแค่ใส่โฆษณาไว้ในหน้าแรกเฉยๆแล้วว่า ผมก็ไม่ต้องใส่

wp_header() คือ ดึงไฟล์ header.php มาใช้
wp_footer คือ ดึงไฟล์ footer.php มาใช้


ใช่ไหม เพราะผมไม่ต้องการส่วนหัวและ ท้ายธีม อยากได้แค่ หน้าแรกปล่าวๆ กับใส่แฟลชไว้เป็น intro เฉยๆอะครับ

:wanwan012:
[direct=https://www.facebook.com/aiunlockedvip]สอน AI[/direct]| [direct=https://aiunlock.co/]คอร์ส AI[/direct] | [direct=https://aiunlock.co/]สอน n8n[/direct]  | [direct=https://www.aiunlockinnovations.com/]สอน AI เชียงใหม่[/direct]

TAXZe

อ้างถึงจาก: g-ji ใน 21 ธันวาคม 2009, 12:10:00
สร้างไฟล์ใหม่ ตั้งชื่อว่า home.php

ข้างในไฟล์


<?php get_header(); ?>

<h1>This is Your Home</h1>

<?php get_footer(): ?>


แล้วอัพไปไว้ในธีมที่ใช้ อ้อ ดูธีมที่ใช้ดีๆ ก่อนนะว่ามันไม่ได้มีไฟล์ชื่อ home.php อยู่แล้ว  :P ถ้ามันไม่มีปัญหาเวลาเข้าเว็บไป มันจะขึ้น This is Your Home ตัวใหญ่ๆ นะ

wp_header() คือ ดึงไฟล์ header.php มาใช้
wp_footer คือ ดึงไฟล์ footer.php มาใช้

เท่ากับว่า ทำตัว content ของหน้า home อย่างเดียว หรือจะเขียนใหม่หมดเลยก็ได้ ไม่ต้องใช้ คำสั่งข้างบนทั้ง 2 อันเลยก็ได้ เอาไปลองใช้ดู

แก้ไขฟังก์ชันนิด จี้เบลอ - -*

ตามนี้ครับ มันจะเรียกไฟล์ home.php เป็นไฟล์แรกให้เลย ไม่ต้องเซตอะไร


หรือไม่ก็ option > reading > เซตให้มันเรียกจาก page ไหน

แล้วก็ไปทำ template page โดนเฉพาะต่อก็ได้


[direct=https://www.taxze.com/ups-review/]รีวิว ups[/direct][direct=https://www.taxze.com/ups-review/]ups ยี่ห้อไหนดี[/direct][direct=https://twitter.com/taxze][/direct][direct=https://www.instagram.com/taxze][/direct][direct=https://rrbg.blogspot.com/][/direct]

Normaderm

[direct=https://www.facebook.com/aiunlockedvip]สอน AI[/direct]| [direct=https://aiunlock.co/]คอร์ส AI[/direct] | [direct=https://aiunlock.co/]สอน n8n[/direct]  | [direct=https://www.aiunlockinnovations.com/]สอน AI เชียงใหม่[/direct]

g-ji

อ้างถึงจาก: Normaderm ใน 21 ธันวาคม 2009, 23:43:39

อ้างถึงผมเคยทำทีหนึ่ง ที่นี่ http://www.na-nguabanphaeng.com/ แต่เป็นวิธีการแก้โค้ดซึ่งตรงไหน ผมกำลังหาอยู่ไว้เจอแล้วจะมาบอก


ใช่แล้วครับ ผมหมายถึงแบบนี้หล้ะ  :P

อ้างถึงจาก: g-ji ใน 21 ธันวาคม 2009, 12:10:00
สร้างไฟล์ใหม่ ตั้งชื่อว่า home.php

ข้างในไฟล์


<?php get_header(); ?>

<h1>This is Your Home</h1>

<?php get_footer(): ?>


แล้วอัพไปไว้ในธีมที่ใช้ อ้อ ดูธีมที่ใช้ดีๆ ก่อนนะว่ามันไม่ได้มีไฟล์ชื่อ home.php อยู่แล้ว  :P ถ้ามันไม่มีปัญหาเวลาเข้าเว็บไป มันจะขึ้น This is Your Home ตัวใหญ่ๆ นะ

wp_header() คือ ดึงไฟล์ header.php มาใช้
wp_footer คือ ดึงไฟล์ footer.php มาใช้

เท่ากับว่า ทำตัว content ของหน้า home อย่างเดียว หรือจะเขียนใหม่หมดเลยก็ได้ ไม่ต้องใช้ คำสั่งข้างบนทั้ง 2 อันเลยก็ได้ เอาไปลองใช้ดู

แก้ไขฟังก์ชันนิด จี้เบลอ - -*

อันนี้ผมเข้าใจถูกไหมครับ คุณจี้ คือให้ผมไปทำ อินโปร ในหน้า home.php แล้วไปเซ็ท home.php เป็นหน้าแรก ซึง
ถ้าตามที่ผมต้องการ คือแค่ใส่โฆษณาไว้ในหน้าแรกเฉยๆแล้วว่า ผมก็ไม่ต้องใส่

wp_header() คือ ดึงไฟล์ header.php มาใช้
wp_footer คือ ดึงไฟล์ footer.php มาใช้


ใช่ไหม เพราะผมไม่ต้องการส่วนหัวและ ท้ายธีม อยากได้แค่ หน้าแรกปล่าวๆ กับใส่แฟลชไว้เป็น intro เฉยๆอะครับ

:wanwan012:

ใช่ เขียนโค้ดยังไงก็ได้ แต่ขอให้ตั้งชื่อไฟล์ว่า home.php แล้วในธีมที่ใช้ต้องไม่มี home.php อยู่ ก็เรียบร้อย จะทำลิ้งก์อะไรยังไงตามสบาย...

Normaderm

ขอบคุณทุกคนมากครับ

:P ทีนี่ผมจะได้มีป้าย วันพ่อ วันแม่ กะเขาบ้าง  :P
[direct=https://www.facebook.com/aiunlockedvip]สอน AI[/direct]| [direct=https://aiunlock.co/]คอร์ส AI[/direct] | [direct=https://aiunlock.co/]สอน n8n[/direct]  | [direct=https://www.aiunlockinnovations.com/]สอน AI เชียงใหม่[/direct]

select2web

กลับมาตอบแล้วครับ ให้เปิดไฟล์ wp-includes\canonical.php บรรทัด 207

แก้จาก
// trailing /index.php
$redirect['path'] = preg_replace('|/index.php/*?$|', '/', $redirect['path']);


เป็น
// trailing /index.php
$redirect['path'] = preg_replace('|/index.php/$|', '/', $redirect['path']);

รับทำธีม smf,wordpress
[email protected]
บทความการเขียนโปรแกรม
select2web.com
บทความเวิร์ดเพรส
select2webstore.com

p1i3c1h

อ้างถึงจาก: g-ji ใน 21 ธันวาคม 2009, 12:10:00
สร้างไฟล์ใหม่ ตั้งชื่อว่า home.php

ข้างในไฟล์


<?php get_header(); ?>

<h1>This is Your Home</h1>

<?php get_footer(): ?>


แล้วอัพไปไว้ในธีมที่ใช้ อ้อ ดูธีมที่ใช้ดีๆ ก่อนนะว่ามันไม่ได้มีไฟล์ชื่อ home.php อยู่แล้ว  :P ถ้ามันไม่มีปัญหาเวลาเข้าเว็บไป มันจะขึ้น This is Your Home ตัวใหญ่ๆ นะ

wp_header() คือ ดึงไฟล์ header.php มาใช้
wp_footer คือ ดึงไฟล์ footer.php มาใช้

เท่ากับว่า ทำตัว content ของหน้า home อย่างเดียว หรือจะเขียนใหม่หมดเลยก็ได้ ไม่ต้องใช้ คำสั่งข้างบนทั้ง 2 อันเลยก็ได้ เอาไปลองใช้ดู

แก้ไขฟังก์ชันนิด จี้เบลอ - -*

แล้วเราจะลิงค์จาก home.php ไปหน้า index.php ยังไงเหรอครับ
[direct=http://diarybe.com]My personal blog[/direct]

p1i3c1h

อ้างถึงจาก: select2web ใน 21 ธันวาคม 2009, 22:33:27
เห็นพี่หรั่ง แกตอบมาอย่างนี้

kay, create the intro page and name it intro.html or index.html or whatever you want.html then open your .htaccess file and add:

DirectoryIndex intro.html index.php

This goes at the very top of the .htaccess file.

This will cause the server to load the first page in that list by default, then just simply link that file to the rest of your WP pages. or however you need it to work

ไม่รู้ใช้ได้ป่าวนะลองดู

ผมเคยทำทีหนึ่ง ที่นี่ http://www.na-nguabanphaeng.com/ แต่เป็นวิธีการแก้โค้ดซึ่งตรงไหน ผมกำลังหาอยู่ไว้เจอแล้วจะมาบอก
สุดท้ายผมคงต้องจบด้วยการ เขียน .htaccess ใช่ไหมครับ :wanwan035:
[direct=http://diarybe.com]My personal blog[/direct]

Normaderm

อ้างถึงจาก: select2web ใน 22 ธันวาคม 2009, 16:55:38
กลับมาตอบแล้วครับ ให้เปิดไฟล์ wp-includes\canonical.php บรรทัด 207

แก้จาก
// trailing /index.php
$redirect['path'] = preg_replace('|/index.php/*?$|', '/', $redirect['path']);


เป็น
// trailing /index.php
$redirect['path'] = preg_replace('|/index.php/$|', '/', $redirect['path']);



โอว ขอบคุณนะครับ แต่ผมยังไม่ได้ลอง ท่านใดลองแล้ว วานคอนเฟริมที  :-[
[direct=https://www.facebook.com/aiunlockedvip]สอน AI[/direct]| [direct=https://aiunlock.co/]คอร์ส AI[/direct] | [direct=https://aiunlock.co/]สอน n8n[/direct]  | [direct=https://www.aiunlockinnovations.com/]สอน AI เชียงใหม่[/direct]

p1i3c1h

อ้างถึงจาก: select2web ใน 21 ธันวาคม 2009, 22:33:27
เห็นพี่หรั่ง แกตอบมาอย่างนี้

kay, create the intro page and name it intro.html or index.html or whatever you want.html then open your .htaccess file and add:

DirectoryIndex intro.html index.php

This goes at the very top of the .htaccess file.

This will cause the server to load the first page in that list by default, then just simply link that file to the rest of your WP pages. or however you need it to work

ไม่รู้ใช้ได้ป่าวนะลองดู

ผมเคยทำทีหนึ่ง ที่นี่ http://www.na-nguabanphaeng.com/ แต่เป็นวิธีการแก้โค้ดซึ่งตรงไหน ผมกำลังหาอยู่ไว้เจอแล้วจะมาบอก
ตรงนี้ผมทำแล้วมันวนกลับมาที่เดิมครับ(ผมสร้างไฟล์ .html ขึ้นมา แล้วลิงค์ไปยัง index.php แต่มันไม่ไปที่ index.php มันกลับมาหน้า .html ใหม่อีกรอบครับ??หรือผมลิงค์ผิดT_T)
[direct=http://diarybe.com]My personal blog[/direct]

p1i3c1h

ได้คำตอบแล้วครับ

How To Create A Custom WordPress Page Template

อ่านภาษาปะกิดแล้วไม่รู้เรื่อง พอดูวีดีโอทีกระจ่างเลยครับ ขอบคุณ Youtube จริงๆ คราวหลังมีอะไรที่ไม่รู้ก็ถาม youtube นี่แหละ :'(
[direct=http://diarybe.com]My personal blog[/direct]