ช่วยดูสคริปส่วนนี้ให้หน่อยครับ มันผิดตรงไหน

เริ่มโดย ae18, 27 กุมภาพันธ์ 2013, 10:10:41

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

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

ae18

ภาพ thumnail ที่ควรจะแสดงในแต่ละโพสต์ไม่แสดงครับ มีแค่หัวข้อกับรายละเอียดของแต่ละโพสต์เท่านั้น ไม่รู้ว่าสคริปนี้ผิดตรงไหน รบกวนด้วยครับ


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

<div class="post-alt blog" id="post-<?php the_ID(); ?>">

<?php if ( !get_option('resize') ) { if ( get_post_meta($post->ID'image'true) ) { ?> <!-- DISPLAYS THE IMAGE URL SPECIFIED IN THE CUSTOM FIELD -->

<img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID"image"$single true); ?>&amp;h=57&amp;w=100&amp;zc=1&amp;q=80" alt="<?php the_title(); ?>" class="th" />

<?php } else { ?> <!-- DISPLAY THE DEFAULT IMAGE, IF CUSTOM FIELD HAS NOT BEEN COMPLETED -->

<img src="<?php bloginfo('template_directory'); ?>/images/no-img-thumb.jpg" alt="" class="th" />

<?php } } ?>

<h2><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<p class="post_date">Posted on <?php the_time('d F Y'); ?>. <span class="singletags"><?php if (function_exists('the_tags')) { ?><?php the_tags('Tags: '', '''); ?><?php ?></span></p>

<div class="entry">
<?php the_content('<span class="continue">Read the full story</span>'); ?>
</div>

<p class="posted">Posted in <?php the_category(', '?><span class="comments"><?php comments_popup_link('Comments (0)''Comments (1)''Comments (%)'); ?></span></p>

</div><!--/post-->

[direct=https://runningwiki.blogspot.com/]เริ่มต้นวิ่ง เทคนิคการวิ่ง อาการบาดเจ็บจากการวิ่ง[/direct]

ae18

[direct=https://runningwiki.blogspot.com/]เริ่มต้นวิ่ง เทคนิคการวิ่ง อาการบาดเจ็บจากการวิ่ง[/direct]

asnowman

[direct=http://support.hostneverdie.com/aff.php?aff=494][/direct]
แหล่งซื้อขาย อสังหาริมทรัพย์ ทั้งโครงการใหม่และมือสอง - [direct=https://www.one2property.com/create-a-listing/]วันทูพร็อพเพอร์ตี้[/direct]
ซื้อขาย บ้านมือสอง บ้านเดี่ยว คอนโด ที่ดิน ทาวน์เฮ้าส์ อพาร์ทเม้นท์ อสังหาริมทรัพย์ - [direct=https://www.teedinthailand.com/index.php/en/add-listing]ที่ดินไทยแลนด์[/direct]
ขายเว็บไซต์พร้อมบัญชี adsense ยืนยัน pin แล้ว ชื่อสวย ติดหลายคีย์ ต่อยอดได้ทันที 30,900.-บาทถ้วน สนใจทักมาครับ

arafarn12

ยังไม่กำหนด custon field รึปล่าวท่าน

มั่วๆ ฉบับของผมนะ - -*

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

<div class="post-alt blog" id="post-<?php the_ID(); ?>">

<?php if ( !get_option('resize') ) { if ( get_post_meta($post->ID'image'true) ) { ?> <!-- DISPLAYS THE IMAGE URL SPECIFIED IN THE CUSTOM FIELD -->

<img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php $values get_post_custom_values("image"); echo $values[0]; ?>&amp;h=57&amp;w=100&amp;zc=1&amp;q=80" alt="<?php the_title(); ?>" class="th" />

<?php } else { ?> <!-- DISPLAY THE DEFAULT IMAGE, IF CUSTOM FIELD HAS NOT BEEN COMPLETED -->

<img src="<?php bloginfo('template_directory'); ?>/images/no-img-thumb.jpg" alt="" class="th" />

<?php } } ?>

<h2><a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<p class="post_date">Posted on <?php the_time('d F Y'); ?>. <span class="singletags"><?php if (function_exists('the_tags')) { ?><?php the_tags('Tags: '', '''); ?><?php ?></span></p>

<div class="entry">
<?php the_content('<span class="continue">Read the full story</span>'); ?>
</div>

<p class="posted">Posted in <?php the_category(', '?><span class="comments"><?php comments_popup_link('Comments (0)''Comments (1)''Comments (%)'); ?></span></p>

</div><!--/post-->



ถ้ายังไง ขอดูเวปหน่อย  :-X
เมพ เมพ เมพ บร๊ะมูลใหมล่ะ ?
ERROR: เขียนอะไรบ้างซิ

hotth

ลองแก้ที่เทมเพลตที่ใช้ และโฟลเดอร์ images เป็น 777 ดูครับหากไม่ได้ก็ค่อยว่ากัน

online7

ไฟล์ index.php
<img src="<?php echo get_post_image(); ?>" alt="<?php the_title(); ?>" width="273" height="140" />

และ

ไฟล์ fucntion.php
function get_post_image() {
  global $post, $posts;
  $first_img = '';
  ob_start();
  ob_end_clean();
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
  $first_img = $matches [1] [0];

  if(empty($first_img)){
  $img_dir = get_bloginfo('template_directory');
    $first_img = $img_dir . '/images/thumb.gif';
  }
  return $first_img;
}
รับทำเว็บด้วย Wordpress
- รับติดตั้งและลงเว็บ Wordperss เริ่มต้น 200 บาท
- รับปรับแต่งและแก้ไขธีม Wordpress,SMF เริ่มต้น 400 บาท
- รับโมธีม Wordpress เริ่มต้น 700 บาท จำกัด 1 โดเมน : ไม่จำกัดโดเมน 1500 บาท