751 posts
  • 6 Years of Membership
  • Affiliate Level 1
  • Collector Level 2
  • Exclusive Author
+1 more
CyberShot
says

I have a site

http://www.mtscottchog.org

You may recognize it, it’s a theme purchased here. It is working great, they love the site. My problem is this. Three of the people at the church wanted to have their own blogs. So I set up categories for them and then made a custom page for them. The pages are working fine. The issue is that I don’t believe all the code is working. For example. One of the blogs has 15 posts in it. I had the admin area set to display 10, yet only 5 displayed. Also, there is no navigation at the bottom to view older or newer posts even though he has enough posts to trigger this. Here is my code

http://pastie.org/596807

The blog I am speaking about is here

http://www.mtscottchog.org/ministries/adults/sunday-morning/sunday-morning/

971 posts
  • 6 Years of Membership
  • Author Level 5
  • Collector Level 4
  • Exclusive Author
EireStudio
says

First off, why are you messing with the code, why not just use the category for their ‘blog’ or filter it by author. Am I missing something here?

Your code is ‘wrong’ – You should use query_posts() instead and you have to add some more code to get the pagination working.

Example:

<?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; ?> <?php query_posts(“showposts=20&cat=15&paged=$paged”); ?>

Hope that helps

709 posts
  • Affiliate Level 2
  • Author Level 5
  • Beta Tester
  • Collector Level 2
+2 more
ChillThemes
says
2541 posts
  • Affiliate Level 2
  • Author Level 2
  • Collector Level 3
  • United States
+9 more
CreatingDrew
says
I recommend using WP_Query instead. http://weblogtoolscollection.com/archives/2008/04/13/define-your-own-wordpress-loop-using-wp_query/
Came here to say just that. Using the a WP_Query object makes custom loops really simple and customizable.
751 posts
  • 6 Years of Membership
  • Affiliate Level 1
  • Collector Level 2
  • Exclusive Author
+1 more
CyberShot
says

well, I am messing with the code because I can. It’s how we learn. I don’t remember why the site was set up the way it is. It was set up a while ago. I am sure I had my reason for doing it. Probably because it makes it easier to show the page. The code is made up of a custom page and then each blogger can post to a specific category that goes to that page. It works, it’s just not completly correct as you all already know. I will look into query_posts. Thanks for the links and the example.

751 posts
  • 6 Years of Membership
  • Affiliate Level 1
  • Collector Level 2
  • Exclusive Author
+1 more
CyberShot
says

well none of those options worked for me. The only way I can get it to display any posts at all is to use the code that I am using now. Nothing else has worked. I have been trying for hours with no success.

159 posts
  • 7 Years of Membership
  • Author Level 4
  • Collector Level 1
  • Exclusive Author
peex
says

- Make a file for each 3 category using their ID’s. Like this: category-1.php, category-2.php, category-3.php

- Then make your custom adjustments for them. That’s all. And use default wordpress loop instead of your custom “foreach” one.

by
by
by
by
by
by