Support » Fixing WordPress » Duplicate posts appearing above homepage welcome

  • Resolved taswork11


    I am having an issue with duplicate posts appearing on my main ‘home’ page.
    The home page is set as a static page and showing posts from my ‘blog & news’ page, however I have posts appearing above the welcome text and actual blog posts.
    Link to my site –

    I am a newbie to WP and still trying to work my way around it and have not touched the code. I have read many other posts on here regarding duplicate posts but do not understand what is meant by a ‘loop’ so not sure whether this is the issue.
    I have tried to contact the template developer for support however nearly 3 weeks on and no reply so getting very desperate, can anyone help please?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Inside your div header_large there is a div that is named recent_posts. That div is showing the blog items above your home page text.

    I would try this first if you haven’t already. Go to Appearance -> Themes -> Customize. Make sure the page is set to “static front page” and not “recent posts.”

    Does your theme allow widgets in the header? If so the posts could be coming from a widget that just needs to be removed.

    If it’s not the page setting or a widget then I would consider deleting the div. If you do, make sure to make a copy of the file first before making any changes, that way you can always revert back to the original.

    I also noticed I’m getting 404 errors for javascript that looks like it would be activating a slider on the site?

    Thank you for your quick response,
    homepage is set to static, I have 2 widgets on the homepage header and latest posts, latest posts widget is set to 2, but showing 3 ??! I removed it and all posts disappeared but when reinstated all posts including duplicates came back.
    Can you please explain what you mean by deleting the div?
    I think the theme does have a gallery but I have not played with that yet.
    Thanks Toni

    Just noticed there is an option to have a slider in the header, however I have not selected this, so not sure why the javascript errors.
    Thanks Toni

    Can you remove the widgets in the header and add them to your content widget area?

    The 404 is a not found error. So the javascript that would make the slider function properly is probably not in the right location.

    If you were to remove the div, I would make sure that’s the last solution. Also, I would only do it if you feel comfortable modifying the code and again make sure you back it up before changing it.

    In Appearance -> Editor you should find a file, home.php. You would have to find the div:

    <div class="recent-posts"> until the closing </div>

    Thank you for coming back to me, I cannot resolve the javascript issue as I wouldn’t know where to start looking, can you provide some pointers please?
    I cannot find a home.php but I have a template-home.php, there also does not appear to be a recent posts div, code for homepage is below

     * Template Name: Home Page Template
     * Description: A Page Template for the home page
     * @package WordPress
     * @subpackage Mummy_Blog
     * @since Mummy Blog 1.0
    // are we displaying a sidebar here?
    // if we're using this template it means we are on a "page"
    // and this "page" will have options under it for sidebar etc..
    // incase a plugin at the top does a loop - this one fails.
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            $home_style = 'home_no_thumb';
            if ( has_post_thumbnail() ) {
                //$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( THUMB_IMAGE_WIDTH, THUMB_IMAGE_HEIGHT) );
                //the_post_thumbnail( );
                $home_style = 'home_has_thumb';
                <div class="fancy_picture_box" style="float:right; margin-left:10px;">
                    <!-- start with the plain image you want to be fancified -->
                    <?php the_post_thumbnail( 'home-pretty-thumb' ); ?>
            } ?>
            <div class="home_wrap <?php echo $home_style;?>">
                <h1 style="height:40px;">
                    <span class="florish_title_left"></span>
                    <span><?php the_title(); ?></span>
                    <span class="florish_title_right"></span>
                <div class="entry-content">
                    <?php the_content(); ?>
                    <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'mummyblog' ) . '</span>', 'after' => '</div>' ) ); ?>
                </div><!-- .entry-content -->
                <div class="fancy_hr_home"></div>
        </article><!-- #post-<?php the_ID(); ?> -->
    <?php get_footer(); ?>

    Your help is very much appreciated
    Thanks Toni

    there might be a problem in your header.php
    some recent post widget is coming in header

    I just looked at the site again and I’m no longer receiving the javascript error. So no need to worry about that.

    the template-home.php is the right file. Looking at it I can’t see anywhere that would be causing the issue. Since that div is showing up in your header maybe try looking into the header.php.

    Sorry…without having access to the site or theme it’s hard to determine what exactly is going on.

    Thanks for response guys, I can see lines for blog name and description but not regarding posts, I appreciate your help please, this is the header.php

     * The Header for our theme.
     * Displays all of the <head> section and everything up till <div id="main">
     * @package WordPress
     * @subpackage Mummy_Blog
     * @since Mummy Blog 1.0
    global $wp_query;
    $is_jigoshop = false;
    if(is_post_type_archive('product') ||  is_page( get_option('jigoshop_shop_page_id'))){
        $is_jigoshop = true;
    if(isset($wp_query->post) && isset($wp_query->post->post_content)){
            $is_jigoshop = true;
    if(function_exists('is_jigoshop') && is_jigoshop()){
        $custom_id = $wp_query->query_vars['taxonomy'];
        $value    = get_query_var($wp_query->query_vars['taxonomy']);
    // if we're in jigoshop, change the defaults for our sidebar wrappers.
    if(function_exists('is_product_category') && is_product_category()){
        // we are in a product category
        // default the sidebar to widget_area-3 and put it on the left.
    ?><!DOCTYPE html>
    <!--[if IE 6]>
    <html id="ie6" <?php language_attributes(); ?>>
    <!--[if IE 7]>
    <html id="ie7" <?php language_attributes(); ?>>
    <!--[if IE 8]>
    <html id="ie8" <?php language_attributes(); ?>>
    <!--[if IE 9]>
    <html id="ie9" <?php language_attributes(); ?>>
    <!--[if !(IE 6) | !(IE 7) | !(IE 8) | !(IE 9)  ]><!-->
    <html <?php language_attributes(); ?>>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <meta name="viewport" content="width=device-width" />
    	 * Print the <title> tag based on what is being viewed.
    	global $page, $paged;
    	wp_title( '|', true, 'right' );
    	// Add the blog name.
    	bloginfo( 'name' );
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'mummyblog' ), max( $paged, $page ) );
    <link rel="profile" href="" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <!--[if IE 9]>
    <link href='<?php echo get_template_directory_uri();?>/ie9.css' rel='stylesheet' type='text/css'/>
         * Find out what google fonts we are using for the website
        $used_google_fonts = array();
        $dtbaker_font_body = get_option('dtbaker_font_body','Delius');
        $dtbaker_font_menu = get_option('dtbaker_font_menu','Delius+Swash+Caps');
        $dtbaker_font_title = get_option('dtbaker_font_title','Dancing+Script');
        $used_google_fonts[$dtbaker_font_body] = true;
        $used_google_fonts[$dtbaker_font_menu] = true;
        $used_google_fonts[$dtbaker_font_title] = true;
        echo '<link href="';
        echo implode('|',array_keys($used_google_fonts));
        echo ':400,700" rel="stylesheet" type="text/css"/>';
        echo "\n";
         * Now print out these special styles:
        echo '<style type="text/css">';
            echo "body{ font-family: '".$google_fonts[$dtbaker_font_body][1]."', cursive; }\n";
            echo "#header_menu a, #pregnancy_counter .due_date, .delius { font-family: '".$google_fonts[$dtbaker_font_menu][1]."', cursive; }\n";
            echo ".dancing, h1, .blog h1 span, .blog h2 span, .widget #searchsubmit, .shop_breadcrumb div, div.product p.price, .widget-title, #respond input#submit, #sidebar_image_button, #sidebar_image_shipping, #pregnancy_counter > div{ font-family: '".$google_fonts[$dtbaker_font_title][1]."', cursive; }\n";
        echo '</style>';
    	/* We add some JavaScript to pages with the comment form
    	 * to support sites with threaded comments (when in use).
    	if ( is_singular() && get_option( 'thread_comments' ) )
    		wp_enqueue_script( 'comment-reply' );
    	/* Always have wp_head() just before the closing </head>
    	 * tag of your theme, or you will break many plugins, which
    	 * generally use this hook to add elements to <head> such
    	 * as styles, scripts, and meta tags.
        <!--<script src="<?php /*echo get_template_directory_uri(); */?>/js/jquery.cycle.all.js" type="text/javascript"></script>
        <script type="text/javascript">
        <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    <body <?php body_class(); ?>>
    <div id="wrapper">
        <!-- start the main menu -->
        <div id="header_menu">
            <h3 class="assistive-text"><?php _e( 'Main menu', 'mummyblog' ); ?></h3>
            <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
            <div class="skip-link">"><?php _e( 'Skip to primary content', 'mummyblog' ); ?></div>
            <div class="skip-link">"><?php _e( 'Skip to secondary content', 'mummyblog' ); ?></div>
            <?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
            <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
        <!--end main menu-->
        <!-- start top right ridget area -->
        // call the widget manager to optionally display a group of widgets here.
        <!-- end top right widget area -->
        <div id="content_bg">
    // call the sidebar manager widget:
    // "content_full" shows a widget area that spans the complete width of the page.
    // "before content" starts the <div> tags to display the main content with an optional sidebar.
    Moderator Jan Dembowski


    Brute Squad and Volunteer Moderator

    Have you contacted the theme vendor for support?

    That’s a commercial theme. While it’s good you are getting support here we don’t support commercial themes as it’s not for us to keep vendors in business.

    Part of what you paid for was supposed to be for support from the vendor.

    Edit: Found the support ticket link.

    Hi Jan, yes I have and nearly three weeks on and no reply, have sent various messages and contacted theme forest about a refund but still heard nothing so I am in limbo at the moment so trying all I can and where I can to get support 🙂 I just want to get the darn thing launched!!

    This line of code is referencing the widgets in the header.

    <!-- start top right ridget area -->
        // call the widget manager to optionally display a group of widgets here.
        <!-- end top right widget area -->

    Again, I don’t know the theme you’re working with but what it says in the comment form “call the widget manager to optionally display a group of widgets here” is what I believe is the problem. What that leads me to believe is that you have the widget activated and it needs to be deleted.

    Thanks for all your help Daniel, we ended up taking the latest posts widget out of the homepage widget and placed in an optional widget, if this makes sense.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Duplicate posts appearing above homepage welcome’ is closed to new replies.