Support » Fixing WordPress » Double Post Show on Frontpage

Viewing 2 replies - 1 through 2 (of 2 total)
  • The problem is with the php loop the theme is using. If you know a little bit of coding, then you can customize the php loop in your theme to fix it.

    I think, in your home page (whether in front-page.php or index.php), in code there are two codes regarding the printing of the posts:
    first:
    <?php the_post(); ?>
    and then:
    <?php while ( have_posts() ) : the_post() ?>

    I think the two codes are printing your posts twice. I don’t know whether this is the problem or not, but it seems to me.
    If not, then please share your codes for us to check. 🙂

    i’m new in coding.

    Can u help me? This is my theme index.php

    <?php get_header();

    if (!easel_themeinfo(‘disable_blog_on_homepage’)) {
    Protect();
    $blog_query = array(
    ‘posts_per_page’ => (int)easel_themeinfo(‘home_post_count’),
    ‘paged’ => get_query_var(‘paged’)
    );

    $posts = &query_posts($blog_query);
    if (have_posts()) {
    while (have_posts()) : the_post();
    easel_display_post();
    endwhile;
    if (easel_themeinfo(‘enable_comments_on_homepage’) && (easel_themeinfo(‘home_post_count’) == ‘1’)) {
    $withcomments = true;
    comments_template(”, true);
    } else
    easel_pagination();
    }
    UnProtect();
    }

    get_footer(); ?>

    Can u help me? thx

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Double Post Show on Frontpage’ is closed to new replies.