获取下一个/上一个“照片页面”来自 WordPress

发布于 2025-01-06 11:51:35 字数 702 浏览 2 评论 0原文

虽然有以下功能:

get_next_post();
next_image_link();

但这些功能都不能用于帮助为博客中的照片页面提供前向和后向链接。我知道我可以访问下一张照片,因为 WordPress 的 header.php 中有以下内容,

<!-- RSS & Pingbacks -->
...
<link rel='index' title='HugoPip' href='http://www.something.com' />
<link rel='start' title='Hello world!' href='http://www.something.com/?p=1' />
<link rel='prev' title='Driving Like a BOSS' href='http://www.something.com/?photo=driving-like-a-boss' />
<link rel='next' title='MegaCuts' href='http://www.something.com/?photo=megacuts' />

这些内容是在 wp-include/default-filters.php 中的某处声明的我能看出来。我只是不知道如何访问它们。任何帮助将不胜感激。

While there are functions like:

get_next_post();
next_image_link();

none of these can be used to help provide forwards and backwards links for photo pages in a blog. I know I can access the next photo in line because wordpress has the following in it's header.php

<!-- RSS & Pingbacks -->
...
<link rel='index' title='HugoPip' href='http://www.something.com' />
<link rel='start' title='Hello world!' href='http://www.something.com/?p=1' />
<link rel='prev' title='Driving Like a BOSS' href='http://www.something.com/?photo=driving-like-a-boss' />
<link rel='next' title='MegaCuts' href='http://www.something.com/?photo=megacuts' />

these are declared somewhere in wp-include/default-filters.php from what I can make out. I just don't know how to access them. Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

近箐 2025-01-13 11:51:35

我找到了我正在寻找的东西:

<?php previous_post('%','« previous','no'); ?> / <?php next_post('%','next »','no'); ?>

I found what I was looking for:

<?php previous_post('%','« previous','no'); ?> / <?php next_post('%','next »','no'); ?>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文