Home  >  Article  >  Backend Development  >  typecho 怎么调用隐藏页面中的缩略图?

typecho 怎么调用隐藏页面中的缩略图?

WBOY
WBOYOriginal
2016-06-06 20:42:141047browse

我新建了一个页面 只插入图片 并设置了不公开
我在首页想调用这个页面中的数据 echo这个页面所有图片
应该如何实现

回复内容:

我新建了一个页面 只插入图片 并设置了不公开
我在首页想调用这个页面中的数据 echo这个页面所有图片
应该如何实现

不动脑子比较直接的方法就是自己读数据库咯。

<code>$cid = 1; //修改为你要读取的页面
$db = Typecho_Db::get();
$select = $db->select('text')->from('table.contents')->where('cid = ?', $cid);
$content = $db->fetchAll($select);
$images = $content[0]['text'];
</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn