ベストセラーウィジェットに画像を表示するやり方の覚書
記述はfunction.phpへ
記述はfunction.phpへ
add_filter('usces_filter_bestseller', 'my_bestseller_func', 10, 3);
function my_bestseller_func() {
$args = func_get_args();
list($html, $post_id, $index) = $args;
$post = get_post($post_id);
if ( $index == 0 ){
$img = '/images/one.png';
} elseif ( $index == 1 ){
$img = '/images/two.png';
} elseif ($index == 2){
$img = '/images/three.png';
} else {
}
$list = usces_the_itemImage(0, 100, 50, $post, 'return' ) . '<img src="' . $img . '" />
<li>第' . ($index+1) . '位<a href="' . get_permalink($post_id) . '">' . $post->post_title . '</a></li>
';
return $list;
}
Wordpressのフックなどの件については割愛します。
画像のURLは任意で変更して下さい。
0コメント