• Anybody know how to set up WordPress so that the front page displays an introduction to the site followed by the posts from a single category. Ideally I would like the introductory text to be editable from the WP Admin section via Page edit.

    I have been pulling my hair out over this one!

    Many thanks in advance if you could shed some light on this one!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter abighill

    (@abighill)

    I am already using this plugin but it doesn’t allow you to combine both the introduction and posts on the same page. Or am I missing something?

    You might look for the Adhesive plugin. It allows you to make a single post “sticky” on the front page. Other posts will be below it as normal.

    or, have a look at making your own static home page. See the Creating_a_Static_Front_Page article in the codex. The “Example 3.2” might work for you. Put your static stuff at top with a mini-loop below.

    Thread Starter abighill

    (@abighill)

    Sorted. Not sure if this couldn’t have been done in a more elegant more way but this seems to have solved my issue.

    ———————————-

    <?php
    /*
    Template Name: New Home
    */
    ?>

    <?php get_header(); ?>
    <?php get_sidebar(); ?>

    <div id="maincontent">
    <!-- Home Template -->
    <?php if (have_posts()) : while(have_posts()) : the_post(); ?>

    <div class="post">
    <h3><?php the_title(); ?></h3>
    <div class="thecontent">
    <?php the_content(''); ?>
    </div>
    </div>

    <?php endwhile; endif; ?>

    <?php query_posts('cat=1'); ?>
    <?php if (have_posts()) : while(have_posts()) : the_post(); ?>

    <?php $my_query = new WP_Query('category_name=news');
    while ($my_query->have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID; ?>
    <div class="post">

    <h2><?php the_date(); ?></h2>
    <h3><a>"><?php the_title(); ?></a></h3>
    <div class="thecontent">
    <?php the_excerpt(); ?>

    </div>
    </div>
    <?php endwhile; ?>

    <?php endwhile; endif; ?>

    </div>

    </div>

    <?php get_footer(); ?>

    ———————————-

    1.) This template page has been named home.php.

    2.) Where there is a category with the slug ‘news’ and category ID = 1.

    3.) Static Page plugin is installed as suggested.

    Thanks

    Thread Starter abighill

    (@abighill)

    Correction: this is not resolved.

    See here: https://www.ads-software.com/support/topic/89624

    For some reason it is mulitplying the posting category by the number of posts.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Single Category on Front Page with Introduction’ is closed to new replies.