WordPress.org

Forums

Double Post Show on Frontpage (3 posts)

  1. dhikator
    Member
    Posted 2 years ago #

    I'm using Easel theme with 3 columns. Why does my frontpage has double post every time i make new post? My web is http://pelajaranhidup.com. Can anyone help me to solve this problem?
    Thanks!

  2. Mayeenul Islam
    Member
    Posted 2 years ago #

    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. :)

  3. dhikator
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic