Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   [SOLVED] Category pages - page2cat or templates? (http://forum.bytesforall.com/showthread.php?t=1564)

mcphoto May 6, 2009 01:25 PM

[SOLVED] Category pages - page2cat or templates?
 
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:

http://landalerts.com/screen.gif

Flynn May 7, 2009 01:06 AM

Post the code that you put into the copied index.php including some lines above and below. You shouldn't get an error there

mcphoto May 7, 2009 11:09 AM

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 :
?>


mcphoto May 17, 2009 09:01 AM

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.

Flynn May 17, 2009 05:52 PM

Post your whole wooded.php please

mcphoto May 18, 2009 09:12 AM

thanks Flynn - here's the file - too long to post on the forum. you can download it here:


http://mcarterphoto.com/332/

bcorrigan May 18, 2009 10:46 AM

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

mcphoto May 19, 2009 09:51 AM

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

bcorrigan May 19, 2009 02:23 PM

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.

mcphoto May 20, 2009 07:47 AM

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.

mcphoto May 20, 2009 08:16 AM

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!


All times are GMT -6. The time now is 11:47 AM.

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