[wp]ปรับแต่ง Wordpress

[wp]ปรับแต่ง Wordpress

ปรับแต่ง Wordpress
1. แสดงโฆษณา AdSense เฉพาะผู้ที่เข้ามาผ่าน Search Engine เท่านั้น
บางคนอาจเห็นว่า ทำไมเราได้ Adsense น้อยจังเลย ลองให้วิธีนี้ดูครับ ให้โฆษณาของเราเห็นเฉพาะคนที่เข้าผ่าน Search Engine ต่างๆ เพื่อทำให้ค่า CTR เองเรามากขึ้น

อ่านต่อได้ที่: http://www.scratch99.com/2008/09/avoid-smart-pricing-show-adsense-only-to-search-engine-visitors/ และที่ http://www.wprecipes.com/how-to-display-adsense-to-search-engines-visitors-only

2. หลีกเลี่ยงโพสต์ซ้ำๆกันใน Multiple Loops
ลองอ่านกันดู สำหรับคนที่จะทำธีมจำพวก Magazine หรือไม่ก็เจอปัญหาในธีม Magazine ลองอ่านกันดูครับ

อ่านต่อได้ที่:  http://www.wprecipes.com/how-to-use-two-or-more-loops-without-duplicate-posts


3. แทนที่ ?Next? และ ?Previous? หน้าลิงค์ ด้วย ระบบนำทาง (Pagination)
เพื่อสะดวกแก่ผู้ที่มาเข้าเว็บเรา ด้วยอีกทางหนึ่ง เพราะ ?Next? และ ?Previous? จะไปหน้าอื่นๆ ก็ไม่สะดวกซะด้วยสิ ใช้ระบบเลขหน้านำทาง ดีกว่าเยอะ

4. ดึงภาพจากเนื้อหาหาแสดง โดยอัตโนมัติ
ถึงแม้ Custom Field จะมีประโยชน์ต่อการแสดง thumbnails ก็ตาม แต่มันก็ไม่สะดวกอยู่ดี จึงใช้วิธีกล่าวข้างต้นก็น่าสนใจไม่น้อย (เหมาะสำหรับคนที่ชอบใช้พวกธีม Magazine)
Manipulate images from WordPress post’s content with Regular Expressions
// Start the Loop
<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
<?php
// Set the post content to a variable
$szPostContent = $post->post_content;
// Define the pattern to search
$szSearchPattern = '~<img <^\>>*\ />~';
// Run preg_match_all to grab all the images and save the results in $aPics
preg_match_all( $szSearchPattern, $szPostContent, $aPics );
// Count the results
$iNumberOfPics = count($aPics<0>);
// Check to see if we have at least 1 image
if ( $iNumberOfPics > 0 )
{
    // Now here you would do whatever you need to do with the images
    // For this example I'm just going to echo them
    for ( $i=0; $i < $iNumberOfPics ; $i++ )
    {
         echo $aPics<0><$i>;
    };
};
// ...finish the loop, etc


Once you printed the images its very much possible that you will like to print the text content too, the problem is that if you use the_content(); function images will be printed again as well. To solve this I had to make a little workaround to remove the images and print only the rest of the content:

// This time we replace/remove the images from the content
$szDescription = preg_replace( $szSearchPattern, '' , $szPostContent);
// Apply filters for correct content display
$szDescription = apply_filters('the_content', $szDescription);
// Echo the Content
echo $szDescription;


5. สร้างปุ่ม ?Send to Twitter?
เป็นการโปรโมต หรือ แบ่งปัน เนื้อหาที่เราเขียน ส่งไปยัง Twitter

Nothing hard with this recipe: Simply paste the following code on your single.php file, within the loop:
<a href="http://twitter.com/home?status=Currently reading <?php the_permalink(); ?>" title="Click to send this page to Twitter!" target="_blank">Share on Twitter</a>

6. แสดง Header แบบสุ่ม (Random) ในบล็อก Wordpress ของเรา

Paste the following code in your header.php file:
<?php
$result_random=rand(1, 99);

if($result_random<=33){ ?>
   <div id="header" style="background:transparent url(images/header1.png) no-repeat top left;">
<?php }

elseif($result_random<=66){ ?>
   <div id="header" style="background:transparent url(images/header2.png) no-repeat top left;">
<?php }

elseif($result_random<=99){ ?>
   <div id="header" style="background:transparent url(images/header3.png) no-repeat top left;">
<?php } ?>

<!-- Header code goes here -->
</div>



ID=1494,MSG=1665


⭐️ เราให้คำแนะนำปรึกษา รักษาผลประโยชน์ให้ลูกค้า ของเรา
⭐️ เราอยู่เคียงข้างลูกค้าของเรา ช่วยเหลือ ดูแลบริการ
⭐️ เรารองรับช่องทางติดต่อมากมาย สะดวก เข้าถึงง่าย
⭐️ เราดำเนินธุรกิจยาวนานกว่า20 ปี คุณจึงมั่นใจได้
⭐️ คุณมีสามารถรับบริการทั้งจากบริษัทประกันเจ้าของสินค้า และ เรา (ตัวกลาง)

ไทย มีราว 80 บริษัทประกันภัย สินค้าที่แตกต่าง ทั้ง เงื่อนไข ราคา เคลม ความมั่นคง นโยบาย ฯลฯ
ขายผ่านตัวกลาง กว่า 500,000 ราย : ตัวแทน นายหน้า ธนาคาร บิ๊กซี โลตัส ค่ายรถยนต์ เฮ้าส์แบรนด์ ของประกันภัย หรือ ซื้อตรงกับบริษัทเจ้าของสินค้า
⭐️ ตัวอย่าง การบริการ กดดูที่ลิงค์นี้

"สิ่งที่ต้องคำนึงอันดับแรกในการซื้อประกัน คือ ตัวกลางประกันภัย ซึ่งจะเป็นที่ปรึกษา ช่วยเหลือ ดูแลเรา ตลอดอายุกรมธรรม์"

โปรดรอ

display:inline-block; position:relative;
โทร.(จ-ศ : 9-16) เว้นวันหยุดฯ , ลูกค้าเรา บริการ 24/7/365 , Thursday เวลา 08:09:27pm (ลูกค้าเราติดต่อทางไลน์พิเศษที่ให้ไว้ตอนซื้อประกัน😍)
Copyright © 2018 Cymiz.com., All rights reserved.นโยบาย,ข้อตกลงcymiz.com