wp_head() Clean & Optimize & Secure WordPress
enable classic editor / disable gutenberg in function.php without plugin wordpress //code from wp.org/plugins/enable-classic-editor/ and another if( !..
กับ wordpress แยกออกมาโดยไม่ใช้ wp-content/themes/name/home.php หรือ front-page.php เพื่อในวาระพิเศษวันสำคัญต่างๆ โดยไม่ให้หน้าเว็บแบบพิเศษนี้มันทำงานซ้ำซ้อนกัน
จากปกติที่ เข้าหน้าเว็บแบบ domain.com/ มันจะเรียกไฟล์ที่ index.php ของ wordpress ให้อัตโนมัติ
คราวนี้เราจะให้ เข้าหน้าเว็บแบบ domain.com/ ให้มันเรียกไฟล์ index.html ก่อน แล้วค่อยเข้า index.php ของ wordpress ตามทีหลัง
ก่อนอื่นต้องเชค DirectoryIndex ของ apache ก่อนว่าเรียงการเรียก index.ต่างๆ ได้ตามต้องการหรือยัง
– ของ appserv เข้าไปเชคที่ \AppServ\Apache2.2\conf\httpd.conf
– ของ directadmin ก็เข้าไปเชคที่ /etc/httpd/conf/httpd.conf
แล้วแก้ให้ index.html มาก่อน index.php ก็เป็นอันใช้ได้
.
<IfModule dir_module>
DirectoryIndex index.htm index.html index.php
</IfModule>
.
อย่าลืมรีสตาร์ท apache อีกรอบ(appserv รีเครื่องเลยก็ได้ถ้ามันหลอนๆ)
ให้เปิดไฟล์ /wp-includes/canonical.php ขึ้นมา ไปที่บรรทัด 364 (เทียบจาก wp 4.1)
หาโค้ดประมานนี้
..
// trailing /index.php
$redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']);
..
แก้ /*?$|
เป็น /$|
แบบนี้
..
// trailing /index.php
$redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/$|', '/', $redirect['path']);
..
ก็สามารถใช้ index.htm ที่สร้างขึ้นเอง กับ index.php ของ wordpress ได้ล่ะ
**เรื่องการใช้งานที่ต้องระวัง
ใน theme ของ wordpress ให้ลิ้งค์ภายในของหน้าหลัก ให้มี index.php ต่อท้ายโดเมนเสมอ ไม่งั้นเวลาเปิด domain.com/ มันจะเรียกแต่ index.html แต่ถ้าใช้ rewrite_url ก็แก้เฉพาะลิ้งค์ภายในของหน้าแรกให้เรียก domain.com/index.php ก็ใช้งานได้ปกติ ส่วนอื่นๆ ไม่มีปัญหา
April 21, 2015
enable classic editor / disable gutenberg in function.php without plugin wordpress //code from wp.org/plugins/enable-classic-editor/ and another if( !..
How to Modified RSS Feed URL in WordPress with fucntions.php /without .htaccess & plugin for nginx/apache server. วิธีทำให้ wordpress ใช้ url จาก feed..
วิธีล้างแคช cloudflare ง่ายๆ กดใช้งานได้จากตรง admin menubar ด้านของ Wordpress เพียงแค่เพิ่มโค้ดในไฟล์ function.php ของ theme ที่ใช้งานอยู่ อย่าลืมใส่..
วิธีเซตใช้ https ให้กับโดเมนของเว็บเราโดยไม่ต้องเสียเงินซื้อ ssl ตามเว็บขายโฮส ด้วยระบบของ cloudflare และสามารถมีฟังก์ชันการแคชไฟล์ static เช่น js/css..
#1. Install file module cd /tmp/ wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz tar xvfz ioncube_loaders_lin_x8..
example error curl -I https://www.google.com/ curl: (60) SSL certificate problem: unable to get local issuer certificate . . ..