Bu kod başka bir temada content,loop ve index kısmındaki post sıralama kısmına koyduğumda çalışıyor.
foreach (get_the_category() as $cat) {
echo '<img src="'.z_taxonomy_image_url($cat->term_id).'" alt="" />';
}Fakat aynı kodu aşağıdaki functions.php de kullanırsam hata üretiyor. neresi ile ilgili olduğunu anlamadım.
function post_image_thumbnail() fonksiyonunda kullandığımda thumb resmi gibi biçimlendirme yapmıyor.
function post_image_thumbnail() {
if (has_post_thumbnail($post->ID)) {
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'thumbnail' );
echo '<a href="'.get_permalink().'" rel="bookmark" title="'.get_the_title().'"><img src="'.$image[0].'" alt="'.get_the_title().'" /></a>';
}
else {
echo '<a href="'.get_permalink().'" rel="bookmark" title="'.get_the_title().'">'.zt_get_thumbnail().'</a>';
}
}
function featured_post_image() {
if (has_post_thumbnail($post->ID)) {
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
echo '<a href="'.get_permalink().'" rel="bookmark" title="'.get_the_title().'"><img src="'.get_bloginfo("template_directory").'/timthumb.php?src='.$image[0].'&w=214&h=160" alt="'.get_the_title().'" /></a>';
}
else if (imagesrc()) {
echo '<a href="'.get_permalink().'" rel="bookmark" title="'.get_the_title().'"><img src="'.get_bloginfo("template_directory").'/timthumb.php?src='.imagesrc().'&w=214&h=160" alt="'.get_the_title().'" /></a>';
}
}