• Resolved Alain_B

    (@alain_b)


    With the following code, I am getting twice the display of the post content

    <div id="main">[insert_php]
    query_posts('catname=hike-report&tag=hikereport&showposts=1');
    while (have_posts()) : the_post();
    the_content();
    endwhile;
    [/insert_php]</div>

    When I look at my result via chrome inspect element, I am surprise to see the following two entries:

    class=”post-384 page type-page status-publish hentry”

    and

    class=”post-405 post type-post status-publish format-standard hentry category-home-page tag-hikereport”

    Back at the site, I see only one post and no post exist on the trash. What am I doing wrong? If I go to the post navigation (on another page with the side post navigation), I see only one Recent Posts and if I click on the Archives (only August link is there) and clicking on it, I see that same one post.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Alain_B

    (@alain_b)

    Still can’t figure out, anyone has an idea?

    I dont know if this is what you are asking, but if the problem is that you are getting twice the featured image in your post, add the following CSS

    Appearance/Customize/Custom CSS

    .single-post .attachment-blog-featured {
    display: none;
    }

    Thread Starter Alain_B

    (@alain_b)

    Thank you very much!
    I don’t have Appearance/Customize/Custom CSS
    I do have:
    Appearance/Customize/Site Identity
    Appearance/Customize/Menus
    Appearance/Customize/Widget
    Appearance/Customize/Static Front Page
    Appearance/Customize/Editor

    I added on the editor of style.css just between #page-content and aside, like this:

    #page-content { /* Need a margin from the two floating elements */
    	width: 100%;
    	padding: 15px 0 15px;
    	overflow-y:auto;
    }
    .single-post .attachment-blog-featured {
    display: none;
    }
    #content-wide {
    	width: 66%;
    	margin: 0 1.5% 0 1.5%;
    	float: left;
    	overflow-x:hidden;
    }

    But still didn’t work.

    Again, the actual post looks correct, but I want a page to show the content of that post, and this is where the data display on the page gets duplicate
    Thanks!

    Thread Starter Alain_B

    (@alain_b)

    Ok if I replaced catname with category_name in the query_posts on the page, I am getting closer, but if I use cat_Name, I am back with double of everything. Now it seems that my last issue is showposts=1 is not showing only one…

    Thread Starter Alain_B

    (@alain_b)

    Still getting twice the posts, once without the header (such as the title) and once with the header (the actual title of the post).

    Thread Starter Alain_B

    (@alain_b)

    OK I got it… my issue was that I am re-using the same variable, and also that I use querypost in place of WP_Query.

    Sorry!!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Keep on getting display of post twice on page’ is closed to new replies.