• I’m running WP from CVS in my custom PHP-site and have used the category_name GET variable and list_cats() to segment my weblog and articles section (using two parent categories). Thus, when people go to /news/?category_name=Weblog they get the weblog categories and when they go to /articles/?category_name=Articles I want the articles category to be shown.

    I’m using a custom theme to embed WP in my site which works great. However, I want the layout to be different and the sidebar to disappear for the articles section. This is turning out to be tricky.

    Softlinking /articles to /news won’t cut it, since it’ll use the same custom WP template as news. I can create a custom index.php which calls wp-blog-header.php, but that’ll also give me the same template. The best solution would be to be able to create a new template for articles and change templates on-the-fly (using GET), but WP doesn’t seem to support this. Short of ripping apart the WP call stack from wp-blog-header.php and inserting it all into my /articles/index.php or doing another WP install, I’m at a loss.

    Can anyone help?

    Thanks,
    G.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter geddeth

    (@geddeth)

    Well, seems I solved the problem in a completely different manner: I carry a global PHP variable that indicates which section of the site is loaded a the moment, and can leave out the sidebar and change the list_cats() parameters according to whether I’m in News or Articles. I did this in the custom template, and it seems to work.

    It’s not very clean as it sets WP aside somewhat, but at least it stays in one template and I don’t have to hack (much). Now for some sleep. ??

    Cheers,
    G.

    Thread Starter geddeth

    (@geddeth)

    .. of course, clicking on category links or titles always sends you to the /news page … hmm. Must think more.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Running WP from two directories?’ is closed to new replies.