1. 使用Wordpress相册

  2. Wordpress2.5加入了全新的相册功能,我们以前也介绍过如何在日志和页面中调用它。但这个功能相当单薄,让我们来丰富一下:
    打开single.php并另存为image.php,在the_content函数之前插入以下代码:



    1. <p class="attachment">

    2. <a href="<?php echo wp_get_attachment_url($post->ID); ?>">< ?php echo wp_get_attachment_image( $post->ID, 'medium' ); ?></a>

    3. </p>

    4. <div class="caption">

    5. < ?php if ( !empty($post->post_excerpt) ) the_excerpt(); // this is the "caption" ?>

    6. </div>



    the_content函数之后插入以下代码:



    1. <div class="imgnav">

    2. <div class="imgleft">< ?php previous_image_link() ?></div>

    3. <div class="imgright">< ?php next_image_link() ?></div>

    4. </div>

    5. <br clear="all" />

    6. ?>


    css样式:




[更多查看原文]

点评 Trackback 收藏它 拍它!
挖上一个精彩
挖客给您推荐更多精彩!
挖下一个精彩

这些挖友臭味相投 · · · · · ·


挖友说 · · · · · ·

 

匿名评论
(尊重网上道德,承担一切因您的行为而直接或间接导致的法律责任)

 

 
合作伙伴:   网易科技   赛迪社区   刷刷   煎蛋   动态网站制作指南   265上网导航   新新web2.0   9Fav就喜欢网   Linux桌面中文网   DigiArt   我爱水煮鱼   奇趣发现   IB资讯
  天涯海阁   乐婴网   cngadget   有意思吧   软件一千零一页  DiggLife  设计|生活|发现新鲜   掘客巴士  17Fav  掘图志   桑林志   91新鲜网   精灵的天下