• Resolved taswork11

    (@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 – https://www.masara.co.uk/Blogs/BabyInformer/

    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?
    Thanks

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?

    Thread Starter taswork11

    (@taswork11)

    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

    Thread Starter taswork11

    (@taswork11)

    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>
    Thread Starter taswork11

    (@taswork11)

    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

    <?php
    /**
     * 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..
    
    the_post();
    
    get_header();
    
    // incase a plugin at the top does a loop - this one fails.
    wp_reset_postdata();
    ?>
    
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            <?php
            $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) );
                //print_r($image);
                //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></div>
                </div>
                <?php
            } ?>
    
            <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>
                </h1>
    
                <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>
            </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.

    Thread Starter taswork11

    (@taswork11)

    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

    <?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)){
        if(strpos($wp_query->post->post_content,'[jigoshop')!==false){
            $is_jigoshop = true;
        }
    }
    if(function_exists('is_jigoshop') && is_jigoshop()){
        $is_jigoshop=true;
    }
    /*if($wp_query->query_vars['taxonomy']){
        $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($is_jigoshop){
        do_action('widget_area_set_default_position','main','pos_hidden');
    }
    
    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.
        do_action('widget_area_set_default_widget','main','widget_area-3');
        do_action('widget_area_set_default_position','main','pos_left');
    }
    
    ?><!DOCTYPE html>
    <!--[if IE 6]>
    <html id="ie6" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if IE 7]>
    <html id="ie7" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if IE 8]>
    <html id="ie8" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if IE 9]>
    <html id="ie9" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if !(IE 6) | !(IE 7) | !(IE 8) | !(IE 9)  ]><!-->
    <html <?php language_attributes(); ?>>
    <!--<![endif]-->
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <meta name="viewport" content="width=device-width" />
    <title><?php
    	/*
    	 * 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 ) );
    
    	?></title>
    <link rel="profile"  />
    <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'/>
    <![endif]-->
    
    <?php
    
        /**
         * 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 ;
        echo implode('|',array_keys($used_google_fonts));
        echo ':400,700" rel="stylesheet" type="text/css"/>';
        echo "\n";
        /**
         * Now print out these special styles:
         */
        $google_fonts=dtbaker_get_google_fonts();
        echo '<style type="text/css">';
        if($dtbaker_font_body){
            echo "body{ font-family: '".$google_fonts[$dtbaker_font_body][1]."', cursive; }\n";
        }
        if($dtbaker_font_menu){
            echo "#header_menu a, #pregnancy_counter .due_date, .delius { font-family: '".$google_fonts[$dtbaker_font_menu][1]."', cursive; }\n";
        }
        if($dtbaker_font_title){
            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.
    	 */
    	wp_head();
    
    ?>
        <!--<script src="<?php /*echo get_template_directory_uri(); */?>/js/jquery.cycle.all.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function(){
                $('#slideshow').cycle();
            });
        </script>-->
        <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    </head>
    
    <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' ) ); ?>
        </div>
        <!--end main menu-->
    
        <!-- start top right ridget area -->
        <?php
        // call the widget manager to optionally display a group of widgets here.
        do_action('widget_area_manager_hook','header_logo_area');
        ?>
        <!-- end top right widget area -->
    
        <div id="content_bg">
    
    <?php
    
    // call the sidebar manager widget:
    // "content_full" shows a widget area that spans the complete width of the page.
    do_action('widget_area_manager_hook','content_full_page');
    // "before content" starts the <div> tags to display the main content with an optional sidebar.
    do_action('widget_area_manager_hook','before_content');
    
    ?>
    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Have you contacted the theme vendor for support?

    https://themeforest.net/item/mommy-blog-premium-wordpress-jigoshop-theme/1155240

    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.

    https://support.dtbaker.com.au/support-ticket.html

    Thread Starter taswork11

    (@taswork11)

    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 -->
        <?php
        // call the widget manager to optionally display a group of widgets here.
        do_action('widget_area_manager_hook','header_logo_area');
        ?>
        <!-- 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.

    Thread Starter taswork11

    (@taswork11)

    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.