找到并修复丢失的div标签 - WordPress自定义模板

时间:2012-07-12 14:02:31

标签: php wordpress html wordpress-theming

我遇到了网页http://www.believeinstjohn.com/store/

的问题

我最终要完成的是将侧边栏移动到正确的位置(右侧栏栏)。它显示三个缺少</div>标记,它是一个WordPress网站,页面使用自定义模板。我无法弄清楚丢失的标签在哪里。模板从网站的其余部分提取资源,其他页面也很好。其中两个div(容器和容器-2)位于header.php中,但关闭它们会弄乱整个站点。我一定错过了模板中的内容,但看不到它。这是模板的PHP

<?php
/**
 * Template Name: Products
 *
 * Selectable from a dropdown menu on the edit page screen.
 * @package WordPress
 * @subpackage Adventure_Journal
 */
$themeOpts = get_option('ctx-adventurejournal-options');
get_header();
?>

        <div class="content" <?php ctx_aj_getlayout(); ?>>
            <div id="col-main" style="<?php echo ctx_aj_customwidth('content'); ?>">
              <div id="main-content" <?php //ctx_aj_crinkled_paper(); ?>>

    <?php 
    global $wp_query, $post;
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $tax = $wp_query->query_vars['product-category'];
    query_posts( array ('post_type' => 'products', 'paged' => $paged, 'product-category' => $tax ) );
    $loop_counter = 1;
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <li class="product <?php if ( $loop_counter == 2 ) { echo "product-last"; } ?>">
            <div class="product_wrap">
                <?php 
                $title = get_the_title().' ';
                $chars_title = strlen($title);
                $title = substr($title,0,28);
                $title = substr($title,0,strrpos($title,' '));
                if ($chars_title > 28) { $title = $title."..."; } 

                $excerpt = get_the_excerpt();
                if (strlen($excerpt) > 150) {
                $excerpt = substr($excerpt,0,strpos($excerpt,' ',80)); } ;
                $excerpt = $excerpt.' ...';

                if (has_post_thumbnail()) {
                    echo '<a href="'. get_permalink() .'" class="product-thumb" title="'. the_title_attribute('echo=0') .'">';
                    the_post_thumbnail( 'Product Thumb', array('title'=>$post_title) );
                    echo  '</a>';
                }
                ?>
                <h3 class="entry-title product-title"><a href="<?php the_permalink(); ?>" class="title"><?php echo $title; ?></a></h3>
                <div class="product_content">
                    <?php echo apply_filters('the_excerpt',$excerpt); ?>
                </div>
                <div class="product_details">
                    <a class="button" href="<?php the_permalink(); ?>">More Info</a>
                </div>
            </div>
        </li>
        <?php if ( $loop_counter == 2 ) {
            $loop_counter = 1;
            echo '<li class="clear"></li>';
        } else {
            $loop_counter++;
        } ?>
     <?php endwhile; else: endif;  ?>
 <div class="clear"></div>
        <?php get_sidebar('store'); ?>
 <?php get_footer(); ?>

1 个答案:

答案 0 :(得分:0)

你在哪里关闭以下标签?

<div class="content" <?php ctx_aj_getlayout(); ?>>
<div id="col-main" style="<?php echo ctx_aj_customwidth('content'); ?>">
<div id="main-content" <?php //ctx_aj_crinkled_paper(); ?>>