php 获取Wordpress中主要帖子页面的URL

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 获取Wordpress中主要帖子页面的URL相关的知识,希望对你有一定的参考价值。

<?php
/**
						 * Get blog posts page URL.
						 * https://kellenmace.com/get-blog-posts-page-url-permalink-wordpress/
						 *
						 * @return string The blog posts page URL.
						 */
						function dlrg_get_blog_posts_page_url() {
							// If front page is set to display a static page, get the URL of the posts page.
							if ( 'page' === get_option( 'show_on_front' ) ) {
								return get_permalink( get_option( 'page_for_posts' ) );
							}
							// The front page IS the posts page. Get its URL.
							return get_home_url();
						}
?>

以上是关于php 获取Wordpress中主要帖子页面的URL的主要内容,如果未能解决你的问题,请参考以下文章