Ready to get started?Download WordPress


[resolved] Only Showing 4 posts on frontpage, despite settings (4 posts)

  1. paulhoefgen
    Posted 4 years ago #


    Im struggling through setting up http://www.paulhoefgen.com with f8 lite and was merrily creating content, however, once i got to the 5th post, the first post fell off into oblivion.

    From what I can makeout from the index.php file, it should loop until all the posts are generated, limited by the dashboard setting (in this case, it is set to the 10 most recent posts.) But for some reason, it stops at 4 posts. Ive seen the theme demoed with multiple lines of posts under the header, so I dont think Its that.

    Is there another setting somewhere? My php skills are very weak im afraid, I can barely follow the basic logic, but have no concept of the syntax...

    Here is the content of the index.php file:

    <?php get_header(); ?>
    <?php if (have_posts()) : ?>
    <?php $i = 0; ?>
    <?php while (have_posts()) : the_post(); $i++; ?>
    <div class="span-8 post-<?php the_ID(); ?><?php if ($i == 3) { ?> last<?php  } ?>">
    <h6 class="archive-header"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title() ?></a></h6>
    	$values = get_post_custom_values("thumbnail");
    	if (isset($values[0])) {
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php $values = get_post_custom_values("thumbnail"); echo $values[0]; ?>" alt="" /></a>
    <?php } ?>
    <?php the_excerpt(); ?>
    <p class="postmetadata"><?php the_time('M d, Y') ?> | <?php comments_popup_link('Have your say »', '1 Comment »', '% Comments »'); ?></p>
    <?php if ($i == 3) { ?><div class="archive-stack clear"></div><?php $i = 0; } ?>
    <?php endwhile; ?>
    <div class="clear"></div>
    <div class="navigation">
    	<div><?php next_posts_link('&laquo; Older Entries') ?></div>
    	<div><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    <?php else : ?>
    <h2>Not Found</h2>
    <p>Sorry, but you are looking for something that isn't here.</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    <?php endif; ?>
    <?php include (TEMPLATEPATH . "/bottom.php"); ?>
    <?php get_footer(); ?>
  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    I can see 6 posts on the front page now. Did you manage to find where the problem was?

  3. paulhoefgen
    Posted 4 years ago #

    yessum. very late last night :)

    The standard f8-lite slideshow rotates through images on the 4 latest posts, it controls the while loop by setting the showpost variable to 4 ie


    and then uses custom fields to call user defined images from the latest 4 posts.

    As per the instructions, I changed it to show a static selection of images, so instead of using a loop to generate the URL's of the images, you hardcore an unordered list.

    But the instructions dont mention the showpost=4 variable.
    Because the index.php file calls on slideshow.php before "the loop"
    it takes the showpost variable into account when its displaying the posts.

    So, in other words, all i had to do was change showpost=4 to showpost=6. It didnt work when I deleted all the code that i thought was unnessesary, so i had to kludge it in.

    I ended up re-uploading the entire theme, which took out all of my custom settings, and then re-uploaded the edited files one at a time to find out which php file was causing the fault...

    <!-- Begin slideshow -->
    <?php query_posts('showposts=9'); ?>
    <ul id="portfolio">
    <li><img src="<?php bloginfo('stylesheet_directory'); ?>/images/slideshow/image1.jpg" /></li>
    <li><img src="<?php bloginfo('stylesheet_directory'); ?>/images/slideshow/image2.jpg" /></li>
    <li><img src="<?php bloginfo('stylesheet_directory'); ?>/images/slideshow/image3.jpg" /></li9
    <li><img src="<?php bloginfo('stylesheet_directory'); ?>/images/slideshow/image4.jpg" /></li>

    i dont know why it doesnt work without the query_posts string, but it doesnt...

  4. paulhoefgen
    Posted 4 years ago #

    oh, looking over it now, the call to the slideshow is made in header.php

    also, hardcore=hardcode.

Topic Closed

This topic has been closed to new replies.

About this Topic