【问题标题】:how to edit front end without plugins in Wordpress?如何在 Wordpress 中编辑没有插件的前端?
【发布时间】:2018-11-28 05:50:52
【问题描述】:

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

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

【问题讨论】:

  • 嘿!到目前为止,您需要将代码放在这里。 StackOverflow 社区无法帮助您从头开始编写代码。您需要将代码放在这里,然后我们将帮助您调试该代码。

标签: php wordpress


【解决方案1】:

您需要学习 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 后端获取动态内容。

【讨论】:

    猜你喜欢
    • 2017-12-05
    • 1970-01-01
    • 2014-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多