WordPress.org

Forums

Getting Rid of the "Cat" POST variable (6 posts)

  1. RichardPrice
    Member
    Posted 12 years ago #

    Hi, I run b2/wordpress on my site, and have multiple pages each showing a single different category. The problem is that you have to set the "cat" variable in the POST string to get b2/wordpress to display the category, setting it within the php just results in a blank page.
    Is there any easy way to change this behavior, as i would like to protect these pages from easy modification. I have had a quick look through the code, but cannot find where the code relies on the POST version of the variable.

  2. Mike Little
    Member
    Posted 12 years ago #

    Hi Richard,
    You can add $cat=2; to the top of each of your php pages *before* the require_once('blog.header.php'); line.
    That will force a specific category to be displayed.
    Note it may stop any links output from list_cats() working unless you specifiy a filename to that function. Similar precaution with the category link for each posting.
    Mike

  3. RichardPrice
    Member
    Posted 12 years ago #

    Thanks, that works a treat, i wonder where i was sticking it before.

  4. geistvox
    Member
    Posted 12 years ago #

    Are there plans to allow $posts and $cat to work together so that you can display the $posts most recent entries in a single category? As it is, it seems $cat overrides $posts in the SQL call.

  5. john
    Member
    Posted 12 years ago #

    Hi, I'm still using b2 for my neighborhood association's website, using this method of seperating categories of posts (news, minutes/agenda, and resources, etc...) $cat=whatever; but I'm having problems with the search function and the <<previous next>> thing... It's a mess.
    But now I'm thinking that I can still do this but have all this done from the archive page ... then I could go ahead and switch over to WordPress... Please tell me this will work. :)
    Also, how many links will the link manager hold before it explodes--that would be a huge saver. :)
    You can see what it's doing at http://trinitypark.org

  6. john
    Member
    Posted 12 years ago #

    I saw a website that solved this problem using WP. I just wonder how much editing he had to do, (or which files he had to edit) to get the "WP engine" to run from several different directories. He's got his index page loading in his root/main .. then he's got his categories in seperate directories, then his archives are done the same way, monthly. On top of this, he's got the last 5-10 posts lists.
    Wow. That's what I have been looking for--at least I know it's possible. Is there anyone that can explain how this is possible?
    John

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.