Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Page & Category Menu Bars »

[SOLVED] Category pages - page2cat or templates?


  #1  
Old May 6, 2009, 02:25 PM
mcphoto
 
120 posts · Apr 2009
am struggling with category pages and the category page plugin. (page2cat)

I need several actual pages that display some static content followed by either posts or thumbnails and excerpts. Whichever I go with (posts vs. excerpts) will be global, IE the whole site will use that for post pages.

These need to be actual pages, not category links, so they'll appear in drop down navigation.

In non-Atahualpa sites, I've been able to copy the index as a named template, add static content below "get header", and replace the first loop section with this:

Code:
		<?php if(have_posts()) : ?>
		<?php
   if (is_page()) {
      query_posts("cat=3");
   }
?>

		<?php while(have_posts()) : the_post(); ?>

In Atahualpa I get a parse error, for something like line 329, way down.

If I try the category page plugin, create a page, choose the category in the plugin control, I get nothing - just the static content from the WP "new page" editor - no category-based stuff (or anything else) below it.

If I use the [catlist=xx] code, it works, but all I get is a list, screengrab below.

So, the plugin doesn't seem to work the way the (very broken english) description suggests... there are posts here on the forum regarding hacks, but my understanding is that's written into 3.2 now.

Can anyone point me to the functionality I need?

Thanks a bunch!

Screengrab -4 posts have this category, they show up as a list:

  #2  
Old May 7, 2009, 02:06 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Post the code that you put into the copied index.php including some lines above and below. You shouldn't get an error there
  #3  
Old May 7, 2009, 12:09 PM
mcphoto
 
120 posts · Apr 2009
No luck with that - here's what I get:

Parse error: parse error, unexpected T_ELSE in /home/content/b/l/u/bluegreentexas/html/wp-content/themes/atahualpa332/wooded.php on line 335

Also tried it with page2cat disabled, same thing.

Here's the code:

Code:
<?php get_header(); ?>
<h2>Homesite Specials in Dallas-Forth Worth</h2>

		<?php if(have_posts()) : ?>
		<?php
   if (is_page()) {
      query_posts("cat=9");
   }
?>

		<?php while(have_posts()) : the_post(); ?>

	<?php		
	// Next/Previous PAGE Links (on multi post pages) 
	// in next_posts_link "next" means older posts
And the top of the file:

Code:
<?php
/*
Template Name: Wooded
*/
?>
And here's line 332 - 336:

Code:
<?php			
// END of: If there are any posts 
// If there are no posts: 
else : 
?>
  #4  
Old May 17, 2009, 10:01 AM
mcphoto
 
120 posts · Apr 2009
Bumping this thread back to (hopefully) life -anyone found a "static page with category posts that looks like your other posts page?"

This would be really cool for sites with tons of content, that need a page for each category in the menu structure.
  #5  
Old May 17, 2009, 06:52 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Post your whole wooded.php please
  #6  
Old May 18, 2009, 10:12 AM
mcphoto
 
120 posts · Apr 2009
thanks Flynn - here's the file - too long to post on the forum. you can download it here:


http://mcarterphoto.com/332/
  #7  
Old May 18, 2009, 11:46 AM
bcorrigan
 
85 posts · Feb 2009
I've been using the plugin, List Category Posts

I didn't have complete success implementing Category 2 Pages, and also the fact that you can't have more than one category on a page. unless they are nested categories.

What I like about this plugin is that you just create a page and where you want the categories, you just put in the short code.

Here are some of the useages from the Readme.txt

Quote:
The arguments you can use are:

* 'name' - To display posts from a category using the category's name. Ex: [catlist name=mycategory]

* 'id' - To display posts from a category using the category's id. Ex: [catlist id=24]. If you use both arguments (wrong!), List Category Posts will show the posts from the category in 'name'.

* 'orderby' - To customize the order. Valid values are:
* 'author' - Sort by the numeric author IDs.
* 'category' - Sort by the numeric category IDs.
* 'content' - Sort by content.
* 'date' - Sort by creation date.
* 'ID' - Sort by numeric post ID.
* 'menu_order' - Sort by the menu order. Only useful with pages.
* 'mime_type' - Sort by MIME type. Only useful with attachments.
* 'modified' - Sort by last modified date.
* 'name' - Sort by stub.
* 'parent' - Sort by parent ID.
* 'password' - Sort by password.
* 'rand' - Randomly sort results.
* 'status' - Sort by status.
* 'title' - Sort by title.
* 'type' - Sort by type. Ex: [catlist name=mycategory orderby=date]
* 'order' - How to sort 'orderby'. Valid values are:
* 'ASC' - Ascending (lowest to highest).
* 'DESC' - Descending (highest to lowest). Ex: [catlist name=mycategory orderby=title order=asc]

* 'numberposts' - Number of posts to return. Set to 0 to use the max number of posts per page. Set to -1 to remove the limit. Default: 5. Ex: [catlist name=mycategory numberposts=10]

* 'date' - Display the date of the post next to the title. Default is 'no', use date=yes to activate it.

* 'author' - Display the author of the post next to the title. Default is 'no', use author=yes to activate it.

You can customize the way List Category Posts shows the posts in your CSS by editing "lcp_catlist".
-Bill
  #8  
Old May 19, 2009, 10:51 AM
mcphoto
 
120 posts · Apr 2009
Thanks Bill, but it looks like that Plugin just returns a list, same as page-2-cat; I need static pages that display categories the same way the blog displays posts - in my case thumbnail & excerpt.

This is doable by writing page templates, but with this theme I get parse errors and no page. Hope Flynn has some advice for me! Thanks for your help- MC
  #9  
Old May 19, 2009, 03:23 PM
bcorrigan
 
85 posts · Feb 2009
You might want to check out:
http://dvector.com/oracle/ggis-inlinepost/.

put post in page. It looks like you put in posts one at a time, not from a category, but you might be able to put PHP in a post that calls them up first, then use this plugin to display them.

That would get you away from having to mess with template files, which can break with the next WP or Atahualpa update/upgrade.

I haven't check it out myself though.
  #10  
Old May 20, 2009, 08:47 AM
mcphoto
 
120 posts · Apr 2009
Thanks - I took a look, but it involves adding a tag to every post - we're experimenting with using WP for a real estate site and using categories to search & sort, so they won't go for that.

What I want is really easy in other themes, and I don't mind the template issue. But creating category pages in this theme via templates just gives me parse errors - Flynn had posted that it would work, but he hasn't gotten back to this thread. I'd hate to drop this theme, I've got a ton of hours in this site (and some $$ in the donations box)!

Atahualpa is pretty amazing for me, I'm more of a designer/useability guy than a coder, my personal blog came out great.
  #11  
Old May 20, 2009, 09:16 AM
mcphoto
 
120 posts · Apr 2009
Solved it - really simple, too, just add this:

Code:
<?php query_posts('cat=1&showposts='.get_option('posts_per_page')); ?>
Before the loop.

Took a lot of googling - all I found were other people wanting the same effect!

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Struggling with Page2cat vs Atahualpa 3.4 papabeargrowls Atahualpa 3 Wordpress theme 7 Jul 11, 2009 06:32 AM
Category Templates multiple sidebars ranch2 Sidebars & Widgets 3 May 25, 2009 07:40 PM
Static pages with category posts? mcphoto Atahualpa 3 Wordpress theme 3 Apr 25, 2009 10:48 AM
Images in my category and archive pages? middlemountain Atahualpa 3 Wordpress theme 1 Apr 11, 2009 11:28 PM
Posts showing up twice on category pages? michiganbasketball Atahualpa 3 Wordpress theme 1 Mar 12, 2009 05:56 PM


All times are GMT -6. The time now is 03:54 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.