【问题标题】:Wordpress site isn't displaying the wysiwyg editor content?Wordpress 网站不显示所见即所得的编辑器内容?
【发布时间】:2012-05-14 03:48:18
【问题描述】:

我的 Wordpress 网站真的没有按照我的意愿运行?!

它工作正常,没有任何东西被触及,然后我发现每个页面都在每个页面上显示相同的内容。不是所见即所得编辑器中的单个内容。

这让我很头疼,我有一个修改过的主题,我已经用原始主题文件 page.php、index.php 和 single.php 替换了它,看看它们页面是否有问题。但不是!?

链接是http://www.alleanza.co.uk,我本来想在最后的婚礼上把它交出来,但我仍然不能,因为没有内容被拉过。有没有人有任何可能有帮助的想法?

但是我注意到它是从 Hello World Post 中提取信息,而不是从页面的所见即所得内容中提取信息。

但是,这里是 page.php 的内容

<?php
/*
Template Name: Normal Template
*/
?>

<?php get_header(); ?>

    <div id="content">
    <div id="greybread"><?php if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs(); ?></div>

<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">

                <?php while ( have_posts() ) : the_post(); ?>

                    <?php the_content(); ?>

                    <?php comments_template( '', true ); ?>

                <?php endwhile; // end of the loop. ?>


    <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    </div></div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

【问题讨论】:

标签: php html wordpress content-management-system


【解决方案1】:

您能否在循环中显示您在 page.php 中的代码?

如果循环中缺少&lt;php the_content(); ?&gt; 标记,您将看不到从 Wordpress 仪表板加载的内容。也可能是因为您从页面属性模块中为您的页面选择了非默认模板。

【讨论】:

  • 好吧,我有一点帮助。 alleanza.co.uk/1/hello-world - 它显示 Hello World 帖子而不是页面内容。 P.S 我现在会更新 page.php 信息。
  • 帖子的模板文件是single.php,页面的默认模板文件是page.php。如果显示错误的内容,请确保 the_content();标签存在于两个模板文件的循环中,并且没有完成一些硬编码。还要确保查询是默认查询,如果正在查询特定页面或类别,它将从该页面/类别加载内容,而不是当前帖子。 codex.wordpress.org/Function_Reference/query_posts#Usage
  • 不,它不会,我只是想澄清一下,因为你说内容正在加载你好世界的帖子。如果一个页面正在加载另一个帖子,它可能是一个类别存档页面,在这种情况下,它的默认模板文件是archive.php,或者它的默认查询已在循环外修改(codex.wordpress.org/Function_Reference/query_posts#Usage
【解决方案2】:

请注意,您已在 page.php 中指定了模板名称(模板名称:普通模板)。这意味着这不再是默认模板。如果要将其设为所有页面的默认模板,请删除 get_header() 标记之前的行。 (http://codex.wordpress.org/Pages#What_Template_is_used_to_Display_a_Particular_Page.3F)

或者您可以选择“普通模板”作为“编辑”页面属性下的页面模板。见下文:

http://en.support.wordpress.com/pages/page-attributes/#template

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-10
    • 2017-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多