ThemeShaper Forums » Thematic

[closed]

category posts limited to 5?

(16 posts)
  • Started 3 years ago by lastraw
  • Latest reply from lastraw
  • This topic is resolved
  1. For some reason (probably something stupid on my part) this page only displays the last 5 posts from it's category with no navigation to older posts http://www.nexoakland.com/nexness
    any advice I'd appreciate

    (I already tried upping the post # in the admin and adding

    // create the navigation below the content

    thematic_navigation_below();
    to the template.

    )

    Posted 3 years ago #
  2. do you have more than 5 posts in the category?

    Posted 3 years ago #
  3. There are 10.

    Posted 3 years ago #
  4. Here's the code:

    <?php
    /*
    Template Name: Nexness
    */
    ?>
    <?php
    
        // calling the header.php
        get_header();
    ?>
    <div id="content-menu-page">
      <?php $posts = get_posts('category=3'); foreach ($posts as $post) : start_wp(); ?>
      <div class="entry-title">
        <h4>
          <?php the_title(); ?>
        </h4>
      </div><!-- entry-title -->
      <div class="entry-content">
        <?php the_content(); ?>
        <?php endforeach; ?>
        <?php rewind_posts(); ?>
       </div>  <!-- entry-content -->
      </div><!-- content-menu-page -->
      </div>
      </div>
      </div>
      <?php 
    
        // calling footer.php
        get_footer();
    
    ?>
    Posted 3 years ago #
  5. What's REALLY frustrating is I fixed this problem once before but I forgot what I did. Maybe a cocktail will jar my memory.

    Posted 3 years ago #
  6. well i had to ask the obvious. :)

    i think start_wp() is deprecated and should no longer be used (according to a quick google search)

    try

    $args = array( 'category' => 3 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :	setup_postdata($post); ?>

    difference being setup_postdata($post) instead

    from the codex on get_posts()
    http://codex.wordpress.org/Function_Reference/get_posts

    Posted 3 years ago #
  7. Still not working, maybe I included it wrong?

    `<?php
    /*
    Template Name: Nexness
    */
    ?>
    <?php

    // calling the header.php
    get_header();
    ?>
    <div id="content-menu-page">
    <?php $args = array( 'category' => 3 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) : setup_postdata($post); ?>
    <div class="entry-title">
    <h4>
    <?php the_title(); ?>
    </h4>
    </div><!-- entry-title -->
    <div class="entry-content">
    <?php the_content(); ?>
    <?php endforeach; ?>
    <?php rewind_posts(); ?>
    </div> <!-- entry-content -->
    </div><!-- content-menu-page -->
    </div>
    </div>
    </div>
    <?php

    // calling footer.php
    get_footer();

    ?>`

    Posted 3 years ago #
  8. what happens instead?

    Posted 3 years ago #
  9. Same thing (that's what's live now).

    Posted 3 years ago #
  10. I added 'posts_per_page' => 10 to the array for now, but I don't think it is resolved the right way. It probably IS something obvious! Thanks helgatheviking for the start_wp() info though.

    Posted 3 years ago #
  11. did you solve it b/c you live link is def showing more than 5 posts?

    i'm not sure you need rewind posts, but i dont think it is causing problems either.

    Posted 3 years ago #
  12. In the admin I set to show 100 posts, but for some reason this page defaulted to just 5 posts with no link to older posts. I forced it to show 10 in the array, but why it defaulted to 5 with no link to older posts is the concept I want to grasp.

    Posted 3 years ago #
  13. maybe it would be easier to copy the blog template? and modify the query. it is a bit tricky to modify thematic content based on template, but it is possible.

    Posted 3 years ago #
  14. Thanks HTV, I did a test and that should work better.

    Posted 3 years ago #
  15. too bad we didnt think of the obvious solution right away :)

    Posted 3 years ago #
  16. Story of my life!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.