快速PHP回声帮助

Cam*_*ron 2 php wordpress

这有什么问题?

echo '<a title="Last Chance" href="'.the_permalink().'" class="status open">Last Chance</a>';
Run Code Online (Sandbox Code Playgroud)

因为它是在它the_permalink()之前<a而不是在它内部.

Mar*_*lln 10

Wordpress通常echo是函数内容而不是返回它.

get_permalink()改用.

echo '<a title="Last Chance" href="'.get_permalink().'" class="status open">Last Chance</a>';
Run Code Online (Sandbox Code Playgroud)

http://codex.wordpress.org/Function_Reference/get_permalink http://codex.wordpress.org/Function_Reference/the_permalink