• Resolved captphatsidy

    (@captphatsidy)


    For my homepage at the root of the domain, I’m looking to post some “about” text with only the latest post below it and with my sidebar. I’d then like to have the full blog with every post in the “/blog” directory.

    Is this possible or do I need to think of another work around?

    Thanks,
    Chris

    PS: Whoops, sorry for the multi-post. It stated it error’d out, but apparently it posted. Please keep this topic and feel free to delete the extraneous ones.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Using the WordPress Default Theme as an example.

    1. In wp-content/themes/default copy pages.php to about.php
    2. Edit about.php and after:

    <?php edit_post_link('Edit this entry.', '', '
    '); ?>

    add this:

    <?php $my_query = new WP_Query('showposts=1'); ?>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <?php the_title(); ?>
    <?php the_content(); ?>
    <?php endwhile; ?>

    3. Create a Page called About and write your about text, and point to about.php in the Page Template pulldown.
    4. Create a Page called Blog (don’t need any content)
    5. In Administration > Settings > Reading, set “Front page displays” to “A static page”, set “Front page:” to About, and set “Posts page:” to Blog.

    Please review:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy
    Template Tags
    query_posts()

    Thread Starter captphatsidy

    (@captphatsidy)

    Whoa! Thanks! You solved a lot of problems for me.

    A tip for others on step #3 – You need to add the following at the top to get the “About” page to show up as an option in the Page Template Pulldown:

    <?php
    /*
    Template Name: About
    */
    ?>

    Thanks again,
    Chris

    Hi it workt for me aswell but the post on the frontpage doesnt have a link to the original post. Any ideas how to solved that?

    eivind

    I solved that by changeing this line
    <?php the_title(); ?>

    to

    <h2 class="postTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>

    eivind

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Only last post on homepage and full blog in “/blog” directory’ is closed to new replies.