1.โค๊ดชุดแรก เอาไปใส่ตรงไหนของ function.php ครับ
2.โค๊ดชุดที่สอง เอาไปใส่ใน index.php ใช่หรือเปล่าครับ
รบกวนขอละเอียดเลยนะครับ ขอบคุณครับ
ชุดที่สองเอาไปใส่ในหน้าที่ต้องการดึงรูปนั้นมาแสดงครับ
เช่นหน้า index archive search พวกนี้
ส่วนหน้าแรกถ้าต้องการให้ดึงบทความตามหมวดหมู่ที่ต้องการก็ให้ใช้โค้ดนี้ครับ
<?php $a = 1; $query1 = new WP_Query();$query1->query('showposts=#&cat=*&orderby=desc'); ?><?php while ($query1->have_posts()) : $query1->the_post(); ?>
<li><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" target="_blank"><img src="<?php echo get_post_image(); ?>" alt="<?php the_title(); ?>" width="ความกว้างรูป" height="ความสูงรูป" /></a>
<div><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div></li>
<?php endwhile; ?>
ปล. # = จำนวนบทความที่ต้องการดึง
* = เลขไอดีหมวดหมู่ของบทความที่จะดึง
ส่วนรูปแบบการแสดงลองใช้ css เข้าช่วยนะครับ
