• Has anyone ever set up a seperate index and archive set of pages (named differently, obviously) for a specific category of posting?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Perhaps this page:
    http://codex.wordpress.org/The_Loop_in_Action

    can help you out. See the entries under #4.

    Thread Starter waraxe

    (@waraxe)

    Thanks, geoffe. That looks like what I want.

    Also, I’d been rackin’ my brain to hack some functionality that is IDENTICAL to that accomplished by using <!--more--> Isn’t that pathetic? 🙂

    WarAxe,
    Clicking on a category name doesn’t take you to a “category archive”?

    Thread Starter waraxe

    (@waraxe)

    moshu :: Yeah, what I want to do is to have a seperate page of my site dedicated to Flash files. I would use the newly discovered <!--m ore--> feature to prevent all the files from displaying playing at onece, etc… but I would want only the Flash-category posts to be displayed on this page) along with “previous” and “next” links where appropriate. It sounds like I could just copy my index.php page to, we’ll say media.php and have the loop only show media categories of posts (I’d also hide those categories from other areas).

    Does this sound feasible? But, once I clicked on the post in the media.php page, it would then go to my archives page… which I don’t want. Some of the reason i don’t want that is because of my active-page navigation menu highlighting.

    moshu, does this make sense?

    Let me re-phrase it to make sure I understood it correctly:
    1. There is a category (let’s call it “flash”) and you want to exclude it from your main (aka index) page
    2. You want to display it all the posts from this category on its own template – or not?
    3. small detail: when you write the posts in this category you want to use the <more> quicktag

    All that is very easily doable without introducing any non-WP file (like media.php).
    Where is the problem?

    I think you like to have a special Flash Category template and in that template you use the <--more--> tag.

    If you name the template file after the category, say your category is “flash” and the number for that category is 6 ( check that ) then a template for that category would be category-6.php.

    WP will use this template for category 6 if it exists, see geoffe’s link above.

    When you click on the heading of any post in the Flash category, you are taken to the corresponding single page, where you get the whole post ( and I guess ) including your Flash movie.

    If this doesn’t answer you question, you’ll have to answer moshu’s 🙂

    Thread Starter waraxe

    (@waraxe)

    moshu :: Yes, I think you understand what I’m trying to do. The whole <!--more--> thing is a bit of a red herring in htis discussion, but it’s important for people to visualize that I want an entire list of Flash-related posts to display (just like index.php), but until you clicked on the post to go to the single.php view you wouldn’t see the actual Flash file.

    petit :: Yes, exactly right! The problem is that I wanted my list of flash posts to have a URL like http://www.mysite.com/flash rather than http://www.mysite.com/archives/category/flash. I suppose I could settle for http://www.mysite.com/category-6 (and that would give me a way of keeping my dynamic menu highlighting… but I’d have to hard code those pages).

    I was hoping that, besides excluding the flash posts from the main index.php loop, that I could create a flash.php that had a loop just for Flash-categorized posts… and that clicking the post to go to a single.php view would actually go to something like http://www.mysite.com/flash/joust (where joust is the title of the post).

    Am I in fairy-tale land or is what I’m conceiving reasonable? (or both 🙂

    I think both 😉

    What you intend to do is certainly doable.

    First of all you can exclude the Flash posts from the main index completely by using a conditional statement in The Loop in the index page.

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

    <?php if ( !(in_category(‘6’)) || !is_home() ) { ?>`

    This means that the post should be output if it is not in the category 6 OR if it not on the main index page.

    Second, you can make the category-6.php to behave as you like. You can use a permalink to that page in your links list or let it stay in your category list.

    Third, You don’t have to have the ugly /category-6/ in your permalinks. The structure of your permalinks are set in the Options/Permalinks section of your Dashboard.

    The loop for your Flash related posts, would be in the category-6.php page, where you either use the <–more–> tag or, maybe better, present title and excerpts.

    Thread Starter waraxe

    (@waraxe)

    petit :: Thanks! I’ll look into that. I’m pretty savvy with PHP so I understand what I’ll need to do for excluding… but to be honest I’ve never tread into the scary domain of permalinks. I’ve always blindly trusted WP and anny plugin to “do its thing”. 🙂

    Great suggestion about using excerpts, btw.

    Here’s an important question. Is there a way to (just like with category-6) to use the permalinks “thang” to show my potential post in the manner I want? (i.e. http://www.mysite.com/flash/joust) Can this be done with single.php (or would I have to concoct some other file)?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Seperate category archive?’ is closed to new replies.