0

我很好奇,因为我需要对 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 -->

谢谢你。

4

1 回答 1

1

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

于 2013-06-01T10:52:09.133 回答