如何在single.php页面中添加自定义代码

时间:2015-01-13 14:39:54

标签: html wordpress

我想在single.php页面中添加一个DIV(width:342px; height:280px; float:left),该页面应该在前面标题下的文章开头显示。这是single.php的代码

<main class="content <?php echo $sidebar['content_class']; ?>"  role="main" itemscope itemtype="http://schema.org/Article">
            <?php // THE LOOP
            if (have_posts()) :
                do_action('radium_before_single_post_content');
                while (have_posts()) : the_post();
                    $format = get_post_format();
                    if( false === $format ) { $format = 'standard'; }
                    if( is_attachment() ) { $format = 'attachment'; }
                    get_template_part( 'includes/post-formats/content', $format );
                endwhile;
                do_action('radium_after_single_post_content');
                if( $framework->theme_supports( 'comments', 'posts' ) && ( comments_open() || '0' != get_comments_number() )  ) comments_template( '', true );
            endif;
            ?>
            <meta itemprop="datePublished" content="<?php the_date('c'); ?>"/>
            <meta itemprop="dateModified" content="<?php the_modified_date( 'c' ); ?>"/>
        </main>

0 个答案:

没有答案