将html模板转换为WordPress

时间:2014-07-28 20:24:29

标签: html wordpress

我有一个HTML模板,我想转换为WordPress。这是我的第一个模板WordPress! 但是当我在本地主机上测试模板时,我发现了一个错误

index.php page

 <?php get_header(); ?>

<body dir="rtl">

        <div id="wapper">
            <div id="header">

                <div id="logo">
                    <a href="index.php"><h1> LOGO </H1></a>

                </div>

                <div id="menu">
                    <ul id="mainmenu" >
                        <a href="#"><li class="menu1"></li></a>
                        <a href="#"><li class="menu1"></li></a>
                        <a href="#"><li class="menu1"></li></a>
                        <a href="#"><li class="menu1"></li></a>
                        <a href="#"><li class="menu1"></li></a>
                    </ul>
                </div>
            </div>

            <div id="continer">


                <div id="main">
                <img src="" />

                    <?php if ( have_posts() ) : ?>
                    <?php while ( have_posts() ) : the_post(); ?>
                      <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                        <div class="post-header">
                            <div class="date"><?php the_time( 'M j y' ); ?></div>
                            <h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                            <div class="author"><?php the_author(); ?></div>
                        </div><!--end post header-->
                        <div class="entry clear">
                            <?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail(); ?>
                            <?php the_content(); ?>
                            <?php edit_post_link(); ?>
                            <?php wp_link_pages(); ?>
                        </div><!--end entry-->
                        <div class="post-footer">
                            <div class="comments"><?php comments_popup_link( 'Leave a Comment', '1 Comment', '% Comments' ); ?></div>
                        </div><!--end post footer-->
                      </div><!--end post-->
                    <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
                      <div class="navigation index">
                        <div class="alignleft"><?php next_posts_link( 'Older Entries' ); ?></div>
                        <div class="alignright"><?php previous_posts_link( 'Newer Entries' ); ?></div>
                      </div><!--end navigation-->
                    <?php else : ?>
                    <?php endif; ?>

                </div>
            </div>


<?php get_sidebar(); ?>
<?php get_footer(); ?>

header.php page

 <?php
/**
 * The Header template for our theme
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Twenty_Thirteen
 * @since Twenty Thirteen 1.0
 */
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width">
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    <!--[if lt IE 9]>
    <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
    <![endif]-->
    <?php wp_head(); ?>


    <title dir="rtl">  </title>
    <link rel="stylesheet" href="style.css" media="screen" />
    <meta charset="utf-8">
    <meta name="keywords" content="">
    <link rel="shortcut icon" href="#" type="image/x-icon" />


</head>

0 个答案:

没有答案