[英]How to set permalink of your blog post according to date and title of post?
[英]How to make blog post article title go to their permalink
我目前正在使用此代碼來嘗試鏈接到博客文章的URL。
<a href="<?php get_permalink(); ?>">
<span class="white"><?php the_title(); ?></span></p>
</a>
該代碼位於博客主頁面上,當我當前單擊帖子標題時,它將引導我進入博客主頁面
您可以改用the_permalink(),或在get_permalink()之前添加echo。
使用get_permalink()將檢索帖子的URL,但不顯示它。
在get_permalink
函數中傳遞$postId
。 get_permalink($postId)
<a href="<?php get_permalink($postId); ?>">
<span class="white"><?php the_title(); ?></span>
</a>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.