2012年7月30日 星期一

wordpress顯示分類標題或slug(category name)


在single.php裡這樣用
<?php
$category = get_the_category();
echo $category[0]->slug ;
?>
在category.php裡這樣用
$current_category = single_cat_title("", false);

2012年7月19日 星期四

wordpress取得縮圖網址SRC(thumbnail)


<?php
    $domsxe = simplexml_load_string(get_the_post_thumbnail());
    $thumbnailsrc = $domsxe->attributes()->src;
 ?>


<?php if (has_post_thumbnail()){ ?>

<?php }?>

2012年7月17日 星期二