Wordpress作为CMS,调用内容问题

时间:2011-11-23 00:08:11

标签: php html css wordpress

所以我正在开发我的第一个wordpress网站......

我正在转换http://www.benjaminpotter.org/fleet/ 到wordpress> http://www.benjaminpotter.org/test/

所以已经存在一些问题,但其中一个问题是,我希望通过wordpress将内容调用到索引页面上的“关于我们”部分,以充当CMS。

这是后端的图像:

enter image description here

然而,它最终没有该部分的内容:

enter image description here

这很可能是因为我需要在网站的页面中添加一些代码。

这是该页面的当前代码,我已经评论了我想要调用内容管理位的位置...感谢您的帮助!

<? /* Template Name: Home Page
*/ ?>


<?php get_header(); ?> 





  <div id="tagline"></div>

    <div id="sliderbox">

        <img src="<?php bloginfo('template_url'); ?>/images/index/slider/slider_1.jpg" width="1000" height="466" alt="Don't settle for less" />

        <img src="<?php bloginfo('template_url'); ?>/images/index/slider/slider_2.jpg" width="1000" height="466" alt="Don't settle for less" />

        <img src="<?php bloginfo('template_url'); ?>/images/index/slider/slider_3.jpg" width="1000" height="466" alt="Don't settle for less" />

        <img src="<?php bloginfo('template_url'); ?>/images/index/slider/slider_4.jpg" width="1000" height="466" alt="Don't settle for less" />

  </div>

    <a id="arrow2" class="arrow"></a>

    <a id="arrow1" class="arrow"></a>

    <a href="order.php" id="car_logo_slider" onmouseover="tooltip.show('');" onmouseout="tooltip.hide();">

        <img src="<?php bloginfo('template_url'); ?>/images/index/car_slider/cars1.jpg" width="1001" height="86" alt="cars" />

        <img src="<?php bloginfo('template_url'); ?>/images/index/car_slider/cars2.jpg" width="1001" height="86" alt="cars" />

        <img src="<?php bloginfo('template_url'); ?>/images/index/car_slider/cars3.jpg" width="1001" height="86" alt="cars" />

    </a>

<div id="wrapper-contunue">

<div id="mission_vision_header"></div>

        <? include('inc/quickcontact.html'); ?>

        <div id="mission_vision_text">

            <!-- THE CONTENT MANAGED BIT! -->
            <!-- THE CONTENT MANAGED BIT! -->
            <!-- THE CONTENT MANAGED BIT! -->
            <!-- THE CONTENT MANAGED BIT! -->
            <!-- THE CONTENT MANAGED BIT! -->

        </div>

        <div style="margin-top:450px;" class="seperator"></div>

        <div id="our_process" class="highlighed_div">

            <div id="our_process_header"></div>

            <div id="initial_text_our_process">

            Here at Fleet Avenue, we have a simple and straight forward process towards acquiring our cars for you. This four step process is fast and effective, consisting of the following steps:

            </div>

            <div id="our_process_stages_graphic"></div>

            <div id="explanatiory_text_our_process">

                <div id="process_inquire">

                    <a id="inquire_button" href="order.php"></a>

                </div>


            </div> <?php get_footer(); ?> 

2 个答案:

答案 0 :(得分:1)

<?php echo get_content(); ?>

或者

<?php
global $post;
echo $post->post_content;
?>

答案 1 :(得分:0)

我相信你需要在Wordpress循环中包含你对the_content()的调用

<?php
if ( have_posts() ) {
    while ( have_posts() ) {
        the_content();
    } // end while
} // end if
?>

这是一个非常基本的示例,如果您稍后进行其他调用,则需要在此之后重置查询调用。

此处有更多信息:https://codex.wordpress.org/The_Loop