如何在wordpress index.php页面中包含一个html代码

时间:2013-12-03 17:56:08

标签: wordpress

我需要在wordpress index.php页面中实现html代码。如何做到这一点?

index.php-Wordpress模板

<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme and one of the
 * two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * For example, it puts together the home page when no home.php file exists.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Wp_Bootstrap
 * @since Wp Bootstrap 1.0
 */
 // Gets header.php
get_header();


get_footer();
?>

HTML

<div class="container">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
</div>

1 个答案:

答案 0 :(得分:1)

这很容易。

// Gets header.php
get_header();

//Start of code as part of answer
?>
<div class="container">
<p>Your text here</p>
</div>
<?php

//end of code as part of answer
get_footer();