Support » Themes and Templates » Add post to static home page

  • Resolved johndove523


    Preface – Sorry, I searched the forum and found similar topics but not quite what I need here.


    Please see url

    From a former site I built with help from an experienced WP designer, I copied and pasted some code from the template-homepage.php file into the site I’m currently working on (the link above). I created a post category, and the post is appearing on the page, but it’s below the main (left) and sidebar content.

    template-homepage.php code: (see html comment in the middle, which is my question)

    Template Name: Home
    get_header(); ?>
    if (have_posts()) :
    	while (have_posts()) :
    <!--the following code needs to be combined with the code above in order for the post to follow the content in the home_main (left) div but I don't know enough php to know how to assemble this code correctly-->
    <?php query_posts('showposts=3&cat=4'); ?>
    	<?php while (have_posts()) : the_post(); ?>
    	<div class="home-page-article">
    	<h3><?php the_title(); ?></h3>
    	<?php the_content(); ?>
    	<?php endwhile; ?>
    <?php get_footer(); ?>

    Related Note – I’m relatively new to WP, but I am trying to migrate to designing exclusively with WP. I would appreciate any suggestions that can teach me how to do more advanced things (like what I’m trying to do here). I don’t find the Codex terribly helpful, in that it doesn’t provide a lot of linear processes from start to finish; mostly just provides the pieces of the puzzle without full context. Can anyone recommend a book, video series, etc. that could help me with more advanced WP procedures and techniques? Thank you.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Add post to static home page’ is closed to new replies.