문제

I need code to get post url without a href, for example: <a href="http://mywebsite.com/permalink" rel="permalink">single post title</a>

i just need the url like: http://mywebsite.com/permalink/ on single.php

도움이 되었습니까?

해결책

What you need is get_permalink, e.g.

$current_post_url = get_permalink();

You can either use it inside a post loop, or pass it a post ID as a parameter.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 wordpress.stackexchange
scroll top