Forums

How to: Display static front page, blog, blog post, pages? (2 posts)

  1. l0rry
    Member
    Posted 6 months ago #

    Hi, The site i'm working on is my first WordPress design, So I'm new to this.

    I need WP to display a Static front page, the blog posts, a single blog post and the pages. I got all to work but it makes the blog and pages the same layout. I want it like this; Pages with no date created, Blog with date and blog with date and comments.

    Here's the code i have right now;


    <?php
    // ----- Start the Loop
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <?php if ( is_front_page() ) { ?>
    <!--- jQuery -->

    <?php $my_query = new WP_Query('posts_per_page=1&order=asc');
    while ($my_query->have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID; ?>

    <!--- latest blog post --->
    <!--- WORKS --->
    <?php endwhile; ?>
    <!-- END of Front page -->

    <?php } else if ( is_page('Blog') ) {?>
    <!-- Blog posts here -->
    <!-- DOES NOT WORK -->

    <?php } else { ?>
    <!-- pages here -->
    <!-- blog uses this area too -->

    <?php } ?>
    
    ?php endwhile; else: ?>

    I've read that is_page() does not work inside a Loop.

    The site is at http://www.lorryballantyne.com/p/tecknikz/

  2. peperose
    Member
    Posted 2 months ago #

    I have the same problem like you but cant seem to find a solution.. I see some websites that they can display which blog post to show in their main page. I wonder how they do that...

Reply

You must log in to post.

About this Topic