admin管理员组文章数量:1406943
I want to pass the sub category id number from a post link <a href="<?php the_permalink() ?>">
is there any solution to pass the value from one page to another through link.
we can pass the id as href=?id= and we can get value from at single post as a link will be www.example/post1/?id=22 Which will be dynamic link of a single post and I just need www.example/post1/ a single link and pass the value to single-post page is that possible.
I want to pass the sub category id number from a post link <a href="<?php the_permalink() ?>">
is there any solution to pass the value from one page to another through link.
we can pass the id as href=?id= and we can get value from at single post as a link will be www.example/post1/?id=22 Which will be dynamic link of a single post and I just need www.example/post1/ a single link and pass the value to single-post page is that possible.
1 Answer
Reset to default 1the_permalink()
only displays the URL for the current post in the loop. If you want to link to another post, you can use echo get_the_permalink( 123 );
, where 123
is a post ID.
<a href="<?php echo get_the_permalink( 123 ) ?>">
Note that the_permalink()
and get_the_permalink()
only get URLs for posts. If you want to get the URL for a category (or tag, or other taxonomy term) you need to use get_term_link()
:
<a href="<?php echo get_term_link( 123 ) ?>">
本文标签: postsHow can we pass a value from thepermalink() at WordPress
版权声明:本文标题:posts - How can we pass a value from the_permalink() at WordPress? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744966488a2634978.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论