WordPress代码笔记

原梓番
原梓番
管理员
827
文章
0
粉丝
技术流评论3,065阅读模式

wordpress获取某个特定页面的链接:文章源自原紫番博客-https://www.yuanzifan.com/54528.html

get_page_link(58);

括号中填写的是这个页面的Pageid。文章源自原紫番博客-https://www.yuanzifan.com/54528.html

获取缩略图地址文章源自原紫番博客-https://www.yuanzifan.com/54528.html

    <?php  $full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full'); ?>
                   
<img src="<?php echo $full_image_url[0];?>" alt="">

最末尾的参数full,代表获取完整图片,也可以改为small.large等参数。即使用小的或大的特色图片文章源自原紫番博客-https://www.yuanzifan.com/54528.html 文章源自原紫番博客-https://www.yuanzifan.com/54528.html

站长微信
扫码添加(注明来意)
weinxin
Yuanzifan99
微信号已复制
原梓番博客公众号
博客内容精选
weinxin
原梓番博客
公众号已复制
 

发表评论

匿名网友
确定

拖动滑块以完成验证