WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] why does this meta info show up above my posts (11 posts)

  1. kvnmcwebn
    Member
    Posted 1 year ago #

    This meta data is showing up from my archive page. there are no syntax errors showing up in dreamweaver and I double checked the tutorial code that I used.

    class="post-13 post type-post status-publish format-standard hentry category-dance-classes" id="post-13"
    post shows up here fine......

    heres the code in the archive page:
    `<?php if (have_posts() ) : ?>

    <?php if (is_category()) { ?>
    <h2 id="archiveTitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
    <?php } elseif( is_tag()) { ?>
    <h2 id="archiveTitle">Posts Tagged ‘ <?php single_tag_title(); ?>’</h2>

    <?php } elseif (is_day()) { ?>
    <h2 id="archiveTitle">Archive for <?php the_time('F jS, Y'); ?> </h2>

    <?php } elseif (is_month()) { ?>
    <h2 id="archiveTitle">Archive for <?php the_time('F Y'); ?> </h2>

    <?php } elseif (is_year()) { ?>
    <h2 id="archiveTitle">Archive for <?php the_time('Y'); ?> </h2>

    <?php } elseif (is_author()) { ?>
    <h2 id="archiveTitle">Author Archive</h2>

    <?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    <h2 id="archiveTitle">Archives</h2>
    <?php } ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php post_class() ?> id="post-<?php the_ID(); ?>"

    <div class="entry">

    <h3 ><a href="<?php the_permalink() ?>"><?php the_title(); ?> </a></h3>
    <?php the_excerpt(); ?>

    </div>
    <em class="postedon"> Posted on: <?php the_time('F jS, Y') ?></em>
    <em class="postedby">by <?php the_author() ?></em>
    <div class="postmetadata">
    <?php the_tags('Tags: ', ',', '<br />'); ?>
    Posted in <?php the_category(', ')?> |
    <?php comments_popup_link('No Comments »', ' 1 Comment »', '% Comments »'); ?>

    <?php endwhile; ?>

    <?php else : ?>
    <h2>Not Found</h2>
    <?php endif ; ?>`

  2. Santosh
    Member
    Posted 1 year ago #

    can you share link to problematic webpage it will make easy to understand code.

  3. The code looks ok, maybe it's a css issue and the meta is floating above?
    Maybe the meta needs to be inside the <div class="entry">?
    Can you provide a link to your stie instead?

  4. kvnmcwebn
    Member
    Posted 1 year ago #

    hi thanks for the replies.

    well it's good to know that the syntax looks ok.

    here is a link to a listings page where the problem shows up.

    meta data above excerpts

  5. Santosh
    Member
    Posted 1 year ago #

    i am not able to find loop in your code which is displaying posts.
    because class="post-27 post type-post status-publish format-standard hentry category-services-and-schools" id="post-27"

    it will be above your loop

  6. Khalid Al-Aydeross
    Member
    Posted 1 year ago #

    Maybe WordPress is not recognizing the spaces in your 'class' names? Thereby not treating them as CSS?

  7. Those classes are the output of the body_class() function, which is normally added to the opening <body> tag at the end of your header file. There's no way to tell from your link if there's something wrong with the way it's coded in the header, or if something else (mostly likely a badly-coded plugin) is causing it to be rendered wrong.

  8. kvnmcwebn
    Member
    Posted 1 year ago #

    Hi thanks everyone.
    Amy the only plug in I'm using is the jetpack. Could it be something in the functions.php file thats not right?

    here is the header bit

    ....wp_head();
    ?>
    </head>

    <body <?php body_class(); ?>>
    <header>
    <div id="header">
    <div id="searchbar">
    <aside id="search" class="widget">
    <?php get_search_form(); ?>....

    thanks

  9. kvnmcwebn
    Member
    Posted 1 year ago #

    it's not a plug in problem either.hmm

  10. kvnmcwebn
    Member
    Posted 1 year ago #

    I just removed this:
    <?php while (have_posts()) : the_post(); ?>
    <?php post_class() ?> id="post-<?php the_ID(); ?>"

    I'm not sure what that was in the tutorial for. Working now anyway.

  11. Santosh
    Member
    Posted 1 year ago #

    but it is still on your page

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.