Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Single Blog Post Repeating for no apparent reason

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #148041
    Jon_N
    Participant

    Hey Guys,

    When you navigate to a single blog post the post itself is repeating. I can’t figure out why.

    Here’s the link: Blog

    #148047
    TheDoc
    Member

    Need to see the code for single.php. If there is a lot of stuff, create a private gist (https://gist.github.com/) and provide a link!

    #148453
    Jon_N
    Participant

    Hey @TheDoc Here is my single.php

    <?php       
    

    /**
    * @package WordPress
    * @since 1.0
    */

    wp_enqueue_style( ‘Oswald’, ‘http://fonts.googleapis.com/css?family=Oswald&v2&#8217; );

    $post_type = get_post_type();

    if ( yiw_is_portfolio_post_type( $post_type ) ) {
    get_template_part(‘single’, ‘portfolio’);
    die;
    }

    get_header() ?>

        <div id="primary" class="layout-<?php echo yiw_layout_page() ?>">  
            <div class="inner group">
                <?php if( get_post_meta( get_the_ID(), '_slogan_page', true ) ): ?>
                <div id="slogan">
                    <h1><?php echo get_post_meta( get_the_ID(), '_slogan_page', true ); ?></h1>
                    <h3><?php echo get_post_meta( get_the_ID(), '_subslogan_page', true ); ?></h3>
                </div>
                <?php endif ?>
    
    
                <!-- START CONTENT -->
                <div id="content" class="group">
                    <?php $blog_type = yiw_get_option('blog_type'); ?>
    
                    <?php 
                          switch( $post_type ) {
                              default             : get_template_part('loop', 'index');
                          }
                    ?>
    
                </div>                       
                <!-- END CONTENT -->
    
                <!-- START LATEST NEWS -->
                <?php 
                    if( $post_type == 'bl_testimonials' ) {
                        get_sidebar('testimonials');
                    } else {
                        get_sidebar('blog');
                    }
                ?>
                <!-- END LATEST NEWS -->   
    
            </div>     
         </div> 
    
    #148455
    Senff
    Participant

    Looks like the problem is not in single.php but in the loop. Can you post loop.php?

    Not here on this forum but follow @TheDoc’s instructions.

    #148464
    Jon_N
    Participant

    @TheDoc and @Senff , Here is the link to loop.php

    #148465
    Jon_N
    Participant

    Actually, I found the problem. This:

                        <?php if ( is_single() ) : ?>
                        <div class="the-content"><?php the_content( str_replace( '->', '&rarr;', yiw_get_option('blog_read_more_text') ) ) ?></div>
                        <?php wp_link_pages(); ?>
                        <?php endif; ?>
    

    Was in loop-blog-big.php twice. Thanks for taking a look guys @Senff and @TheDoc

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.