0
如何爲鏈接的url而不是當前頁面設置if/else條件?如何爲鏈接的url設置if()語句?
我有這個代碼的4號線的麻煩:
$args = array('post_type' => 'studies', 'posts_per_page' => 4);
$loop = new WP_Query($args);
while ($loop->have_posts()) : $loop->the_post();
**if(url=the page I want to link to)**
echo '<a href="'.get_permalink().'">'.get_the_post_thumbnail($post->ID, '180,180').'</a>';
else
echo '<a href="#self" class="anchor-hover">'.get_the_post_thumbnail($post->ID, '180,180').'</a>';
endwhile;