如何在此页面的任何部分插入 wordpress 页面标题?
How can I insert wordpress page title in any section of this page?
我想在此页面的任何区域插入 wordpress 页面标题。比如在本页面的博客区显示页面标题。我可以在文本编辑器(博客编辑器)中使用他们的任何代码来显示此标题吗?
您需要在 functions.php 文件中添加一个函数(如果您有的话,在子主题中)。
function post_title_shortcode(){
return get_the_title();
}
add_shortcode('post_title','post_title_shortcode');
你这样称呼它:[post_title]
我想在此页面的任何区域插入 wordpress 页面标题。比如在本页面的博客区显示页面标题。我可以在文本编辑器(博客编辑器)中使用他们的任何代码来显示此标题吗?
您需要在 functions.php 文件中添加一个函数(如果您有的话,在子主题中)。
function post_title_shortcode(){
return get_the_title();
}
add_shortcode('post_title','post_title_shortcode');
你这样称呼它:[post_title]