如何在Wordpress中编辑没有插件的前端?

时间:2018-11-28 05:50:52

标签: php wordpress

我有一个WP网站,其中的模板文件具有静态html内容,但是现在我需要可从WP后端对该内容进行编辑。

我知道the_content和custom字段,但是我们拥有的内容不在一个固定的位置,因此我们可以在页面中的每个内容区域之后都有一个前端编辑按钮,单击该按钮时,带有内容编辑器的弹出窗口将会显示打开,我可以编辑和更新该内容。我

1 个答案:

答案 0 :(得分:0)

您将需要学习Wordpress主题开发。您可以从这里https://codex.wordpress.org/Theme_Development

快速入门

您需要在主题文件中使用一些基本功能,以显示来自后端的动态内容。

wp_head(); /* https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head */

the_content(); /* https://developer.wordpress.org/reference/functions/the_content/ */
the_excerpt(); /* https://developer.wordpress.org/reference/functions/the_excerpt/ */

wp_footer(); /* https://codex.wordpress.org/Function_Reference/wp_footer */

get_the_header();  /* https://codex.wordpress.org/Function_Reference/get_header */
get_the_footer();  /* https://codex.wordpress.org/Function_Reference/get_footer */
wp_enqueue_style(); /* https://developer.wordpress.org/reference/functions/wp_enqueue_style/ */

这些是wordpress中最常用的功能。这将帮助您从wordpress后端获取动态内容。