วิธีแก้ Thumbnail Relate post ไม่ขึ้น By Cymiz

วิธีแก้ Thumbnail Relate post ไม่ขึ้น By Cymiz

วิธีแก้ Thumbnail Relate post ไม่ขึ้น โดย Cymiz

   <div id="featured-category">
   
   <?php $featured_category = get_theme_option('featured_category_id1'); $featured_number = get_theme_option('featured_number1'); ?>
   
   <?php if(($featured_category == 'Choose a category:') || ($featured_number == 'Number of post:')) { ?>
   
   <?php { /* nothing */ } ?>
   
   <?php } else { ?>
   
   <div class="featured-cat-entry">
   <h3> <?php $cat_id = get_cat_id($featured_category); $category = get_cat_name($cat_id); echo $category; ?></h3>
   
   <?php
   $category_id = get_cat_id($featured_category);
   $my_query = new WP_Query('cat='. $category_id . '&' . 'offset=' . '&' . 'showposts='. $featured_number);
   while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; $the_post_ids = get_the_ID();
   ?>
   
   <div class="featured-cat-meta post-<?php the_ID(); ?>">
   
   <?php $values = get_post_custom_values("feat-cat-img"); if (isset($values<0>)) { ?>
   
   <div class="featured-cat-img">
   <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("feat-cat-img"); echo $values<0>; ?>" alt="<?php the_title(); ?>" width="50" height="50" /></a>
   </div><!-- FEATURED CATEGORY IMAGE END -->
   
   <?php } else { ?>
   
   <div class="featured-cat-img">
   <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo get_featcat_image(); ?>" alt="<?php the_title(); ?>" width="50" height="50" /></a>
   </div><!-- FEATURED CATEGORY IMAGE END -->
   
   <?php } ?>
   
   <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
   
   <span class="featured-cat-date">Posted On <?php the_time('l, F jS Y') ?>&nbsp;&nbsp;<?php edit_post_link('Edit'); ?></span>
   
   <p><?php the_excerpt_feat_cat(); ?></p>
   
   <div class="clearfix"></div>
   </div><!-- FEATURED CATEGORY META <?php the_ID(); ?> END -->
   
   <?php endwhile;?>
   
   </div><!-- FEATURED CATEGORY 1 ENTRY END -->
   
   <?php } ?>
   
   
   <?php $featured_category = get_theme_option('featured_category_id2'); $featured_number = get_theme_option('featured_number2'); ?>
   
   <?php if(($featured_category == 'Choose a category:') || ($featured_number == 'Number of post:')) { ?>
   
   <?php { /* nothing */ } ?>
   
   <?php } else { ?>
   
   <div class="featured-cat-entry">
   <h3> <?php $cat_id = get_cat_id($featured_category); $category = get_cat_name($cat_id); echo $category; ?></h3>
   
   <?php
   $category_id = get_cat_id($featured_category);
   $my_query = new WP_Query('cat='. $category_id . '&' . 'offset=' . '&' . 'showposts='. $featured_number);
   while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; $the_post_ids = get_the_ID();
   ?>
   
   <div class="featured-cat-meta post-<?php the_ID(); ?>">
   
   <?php $values = get_post_custom_values("feat-cat-img"); if (isset($values<0>)) { ?>
   
   <div class="featured-cat-img">
   <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("feat-cat-img"); echo $values<0>; ?>" alt="<?php the_title(); ?>" width="50" height="50" /></a>
   </div><!-- FEATURED CATEGORY IMAGE END -->
   
   <?php } else { ?>
   
   <div class="featured-cat-img">
   <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo get_featcat_image(); ?>" alt="<?php the_title(); ?>" width="50" height="50" /></a>
   </div><!-- FEATURED CATEGORY IMAGE END -->
   
   <?php } ?>
   
   <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
   
   <span class="featured-cat-date">Posted On <?php the_time('l, F jS Y') ?>&nbsp;&nbsp;<?php edit_post_link('Edit'); ?></span>
   
   <p><?php the_excerpt_feat_cat(); ?></p>
   
   <div class="clearfix"></div>
   </div><!-- FEATURED CATEGORY META <?php the_ID(); ?> END -->
   
   <?php endwhile;?>
   
   </div><!-- FEATURED CATEGORY 2 ENTRY END -->
   
   <?php } ?>
   
   </div><!-- FEATURED CATEGORY END -->


แทนที่ด้วย

<div id="featured-category">

<?php $featured_category = get_theme_option('featured_category_id1'); $featured_number = get_theme_option('featured_number1'); ?>

<?php if(($featured_category == 'Choose a category:') || ($featured_number == 'Number of post:')) { ?>

<?php { /* nothing */ } ?>

<?php } else { ?>

<div class="featured-cat-entry">
<h3> <?php $cat_id = get_cat_id($featured_category); $category = get_cat_name($cat_id); echo $category; ?></h3>

<?php
$category_id = get_cat_id($featured_category);
$my_query = new WP_Query('cat='. $category_id . '&' . 'offset=' . '&' . 'showposts='. $featured_number);
while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; $the_post_ids = get_the_ID();
?>

<div class="featured-cat-meta post-<?php the_ID(); ?>">

<?php $values = get_post_custom_values("feat-cat-img"); if (isset($values<0>)) { ?>

<div class="featured-cat-img">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("feat-cat-img"); echo $values<0>; ?>" alt="<?php the_title(); ?>" width="50" height="50" /></a>
</div><!-- FEATURED CATEGORY IMAGE END -->

<?php } else { ?>

<div class="featured-cat-img">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo get_featcat_image(); ?>" alt="<?php the_title(); ?>" width="50" height="50" /></a>
</div><!-- FEATURED CATEGORY IMAGE END -->

<?php } ?>

<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>

<span class="featured-cat-date">Posted On <?php the_time('l, F jS Y') ?>&nbsp;&nbsp;<?php edit_post_link('Edit'); ?></span>

<p><?php the_excerpt_feat_cat(); ?></p>

<div class="clearfix"></div>
</div><!-- FEATURED CATEGORY META <?php the_ID(); ?> END -->

<?php endwhile;?>

</div><!-- FEATURED CATEGORY 1 ENTRY END -->

<?php } ?>


<?php $featured_category = get_theme_option('featured_category_id2'); $featured_number = get_theme_option('featured_number2'); ?>

<?php if(($featured_category == 'Choose a category:') || ($featured_number == 'Number of post:')) { ?>

<?php { /* nothing */ } ?>

<?php } else { ?>

<div class="featured-cat-entry">
<h3> <?php $cat_id = get_cat_id($featured_category); $category = get_cat_name($cat_id); echo $category; ?></h3>

<?php
$category_id = get_cat_id($featured_category);
$my_query = new WP_Query('cat='. $category_id . '&' . 'offset=' . '&' . 'showposts='. $featured_number);
while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; $the_post_ids = get_the_ID();
?>

<div class="featured-cat-meta post-<?php the_ID(); ?>">

<?php $values = get_post_custom_values("feat-cat-img"); if (isset($values<0>)) { ?>

<div class="featured-cat-img">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("feat-cat-img"); echo $values<0>; ?>" alt="<?php the_title(); ?>" width="50" height="50" /></a>
</div><!-- FEATURED CATEGORY IMAGE END -->

<?php } else { ?>

<div class="featured-cat-img">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo get_featcat_image(); ?>" alt="<?php the_title(); ?>" width="50" height="50" /></a>
</div><!-- FEATURED CATEGORY IMAGE END -->

<?php } ?>

<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>

<span class="featured-cat-date">Posted On <?php the_time('l, F jS Y') ?>&nbsp;&nbsp;<?php edit_post_link('Edit'); ?></span>

<p><?php the_excerpt_feat_cat(); ?></p>

<div class="clearfix"></div>
</div><!-- FEATURED CATEGORY META <?php the_ID(); ?> END -->

<?php endwhile;?>

</div><!-- FEATURED CATEGORY 2 ENTRY END -->

<?php } ?>

</div><!-- FEATURED CATEGORY END -->


เข้าใจว่า เป็นโค๊ดแบบเก่า จึงทำให้มันไม่ทำงาน

อ้างอิง http://pastebin.com/YjZkN640
ไปที่เว็บ http://pastebin.com/ เพื่อแปลงโค๊ด กด create new paste

สำคัญที่
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo get_featcat_image(); ?>" alt="<?php the_title(); ?>" width="50" height="50" /></a>

ส่วนการใส่โค๊ด

<!--<img src="<?php echo get_post_image(); ?>" alt="<?php the_title(); ?>" width="200" height="130" />
ต่อจาก <div class="post-meta" id="post-<?php the_ID(); ?>">

ในการแก้รูปไม่โชว์หน้าเเรก หรือ achieve นั้น ทำให้ Relate post มันไป Disable โค๊ดอีกตัวที่ดึงรูป Thumbnail สำรอง(รูปขนาดล็กสุด) ที่เราได้ตั้งค่าไว้

หมายเหตุ
รูป thumbnail ของ เว็บโดยทั่วไป มี 3 ขนาด
ใหญ่ สำหรับ Slide Show ขนาดใหญ่
กลาง สำหรับ เมื่อกด Category หรือโชว์หน้าเเรก
เล็ก สำหรับ Relate post


ID=1540,MSG=1712


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

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

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

โปรดรอ

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