1
jasonchao 2014-04-04 14:05:00 +08:00
我试过把图片命名成1.jpg 2.jpg ... n.jpg 调用图片的时候地址写成 img/<?php echo rand(1,n) ?>.jpg
|
2
win2next OP 好的,谢谢。我去试试
|
3
liyandong 2014-04-04 22:59:44 +08:00 1
<?php if( get_post_meta($post->ID, "img", true) ): ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, "img", true); ?>" alt="<?php the_title() ?>" class="fromImg"/></a> <?php else: ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/moren<?php echo(rand(0,9)) ?>.jpg" alt="<?php the_title() ?>" /></a> <?php endif; ?> |
4
win2next OP 谢谢,2楼办法没成功。我试试3楼
|