新的单个帖子与第一个Wordpress帖子没有相同的样式

时间:2016-12-24 07:24:40

标签: php html css wordpress

出于某种原因,正确设计风格的唯一“单一”帖子是第一个样本帖子。当我添加新帖子时,我的侧边栏显示在内容下方,我的评论部分根本不显示。

这是我使用我的新内容编辑的第一个“默认”帖子(hello world),并且样式正确:

correct layout

以下是第二篇文章的内容(不正确),评论部分甚至没有显示。

incorrect layout

这是我的single.php

<?php get_header(); ?>

<section id="single-post-feed" class="container-fluid">
  <div class="article-container">

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

            get_template_part( 'template-parts/content-page', get_post_format() ); 

            the_post_navigation();

            // moved the comments_template() to content-page.php

        endwhile; // End of the loop.
        ?>

    </div>

</section>
<?php get_footer(); ?>

content-page.php

<?php

//Advanced custom Fields
$song_lyrics = get_field('song_lyrics');
$artist_name = get_field('artist_name');
$song_title = get_field('song_title');
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <header class="entry-header">
        <div class="album-artwork-single-post">
        <div class="album-overlay">
            <div class="media-play-btn-container" id="play-pause-toggle">
                <div class="play-pause-ring"></div>
                <a id="media-toggle" href=""><i class="icon ion-ios-play"></i></a>
            </div>
            <div class="artist-track-title-container">
                <div class="artist-name-heading">
                    <?php echo $artist_name ?>
                </div>
                <div class="track-name-heading">
                    <?php echo $song_title ?>
                </div>
            </div>
        </div>
        <div class="sc-artwork">
            <?php the_post_thumbnail(); ?>
        </div>
    </div>
    <div class="info-section">
        <div class="curator-profile-pic-overlay">
            <div class="curator-pic-container">
                                <?php echo get_avatar(get_the_author_meta('ID'), '64'); ?>
                                <?php echo get_avatar(get_the_author_meta('ID'), '80'); ?>
                <!-- <img class="curator-prof-pic" src="" alt="Profile Picture"> -->
            </div>
        </div>
        <div class="btn-curator-container">
            <button type="button" class="btn btn-default  dig-btn"><span class="glyphicon glyphicon-flash"></span><span class="dig-text">Dig</span></button>
            <button type="button" class="btn btn-default  download-btn"><span class="download-text">Download</span></button>
        </div>
        <div class="profile-container">
            <div class="curator-alias">
                <i class="glyphicon glyphicon-ok-circle verified-check"></i><?php the_author();?>
            </div>
            <div class="curator-class">Curator </div>

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

    <div class="entry-content">
    <div class="horiz-sep-bar"></div>
    <div class="the-review">
        <div class="the-review-header">
            WHAT CURATORS ARE SAYING
        </div>
        <div class="the-review-content">
                    <?php
                        the_content();

                        wp_link_pages( array(
                            'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'uncvrd' ),
                            'after'  => '</div>',
                        ) );
                    ?> <span class="curator-credit"> &#58;&#58;  <a class="curator-username" href="#"><?php the_author();?></a></span>
        </div>
        <div class="post-genre-boxes">
                    <?php
                    foreach(get_the_category() as $category)
                    {
                            echo '<a href="'.get_category_link($category->cat_ID).'"><button type="button" class="btn btn-outline-secondary post-genre"><span class="post-genre-text"> '.$category->cat_name.'</span></button></a>';
                    }
                    ?>
        </div>
    </div>
    <div class="horiz-sep-bar"></div>
    <div class="lyrics-container">
        <button class="lyrics-button">
            <a data-toggle="collapse" id="lyric-toggle" href="#collapse1"><i class="icon ion-chevron-down"></i>LYRICS</a>
        </button>

        <div class="lyrics-content" id="lyrics-dropdown">

            <?php echo $song_lyrics ?>

        </div>
    </div>
    <div class="horiz-sep-bar"></div>
    <div class="horiz-sep-bar-white"></div>
    <div class="artist-hub">
        <div class="artist-profile-pic">
            <div class="prof-pic-container">
                <img class="sc-prof-pic" src="https://i1.sndcdn.com/avatars-000280531684-6vslia-t500x500.jpg" alt="">
            </div>
        </div>
        <div class="about-track-title">
            ABOUT "<?php echo $song_title ?>"
        </div>
        <div class="artist-name-hub">
            <?php echo $artist_name ?>
        </div>
        <div class="track-details">
            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima minus tempore distinctio asperiores voluptatum, hic doloremque ipsum! Perspiciatis ratione aliquam quis porro aliquid provident hic, reprehenderit, voluptates quas? Magnam, facere.Lorem ipsum dolor sit amet, consectetur adipisicing elit.
            <div class="stats-socials-container">
                <i class="icon ion-ios-bolt balanced"></i>
                <div class="total-number-digs">14,395</div>
                <div class="artist-social-buttons">
                    <a href=""><i class="icon ion-social-facebook"></i></a>
                    <a href=""><i class="icon ion-social-twitter"></i></a>
                    <a href=""><i class="icon ion-social-instagram"></i></a>
                </div>
            </div>
        </div>
    </div>

    <div class="ad-box-above-comments">
        <div class="ad-box">
            <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
            <!-- UNCVRD Website -->
            <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-2215550501221227" data-ad-slot="9389394438" data-ad-format="auto"></ins>
            <script>
                (adsbygoogle = window.adsbygoogle || []).push({});

            </script>
        </div>
    </div>
                        <?php
                            // If comments are open or we have at least one comment, load up the comment template.
                            if ( comments_open() || get_comments_number() ) :
                                comments_template();
                            endif;
                        ?>
        </div>
    </div><!-- .entry-content -->

    <section id="side-bar">
        <?php get_sidebar(); ?>
    </section>
</article><!-- #post-## -->

让我知道你还需要什么,我可以更新帖子,谢谢!

0 个答案:

没有答案