其中.php文件的wordpress打印出index.php上的博客标题,日期和作者(主要博客列表)

时间:2013-06-01 10:46:47

标签: php wordpress

我很好奇,因为我需要对index.php列表中每个显示的博客帖子的代码标记进行一些修改。

我的意思不是像the_post(),我想看到输入原始html的最低级函数。有一行html我需要附加到我的所有博客,以便谷歌作者的作品。

我收到警告:缺少必填字段“已更新”。在丰富的代码段工具中。不幸的是没有插件服务。

这就是我的主题index.php截至目前的样子:

  <?php if ( have_posts() ) : ?>

        <?php while ( have_posts() ) : the_post(); ?>

               <?php get_template_part( 'content', ( post_type_supports( get_post_type(), 'post-formats' ) ? get_post_format() : get_post_type() ) ); ?>

        <?php endwhile; ?>

        <?php else : ?>

               <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>

        ?php endif; ?>

以下是content.php的相关部分

            <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">

                    <div class="post-content">

                            <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title permalink="0"]' ); ?>

                            <?php echo apply_atomic_shortcode( 'byline', '<div class="byline">' . __( '[entry-published] &middot; by [entry-author] &middot; in [entry-terms taxonomy="category" before=""] [entry-edit-link before=" &middot; "]', 'ascetica' ) . '</div>' ); ?>

                            <div class="entry-content">

                                    <?php the_content(); ?>

                                    <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'ascetica' ), 'after' => '</p>' ) ); ?>

                            </div><!-- .entry-content -->

                            <?php echo apply_atomic_shortcode( 'entry_meta', '<div class="entry-meta">' . __( '[entry-terms taxonomy="post_tag" before="Tags: "]', 'ascetica' ) . '</div>' ); ?>

                            <?php do_atomic( 'close_entry' ); // ascetica_close_entry ?>

                    </div><!-- .post-content -->

            </div><!-- .hentry -->

谢谢。

1 个答案:

答案 0 :(得分:1)

默认情况下,主题index.php文件直接处理来自循环内部的文件。你的主题可能会有所不同。 以下是WordPress模板文件层次结构http://codex.wordpress.org/images/1/18/Template_Hierarchy.png

的可视化
相关问题