I have a WordPress-powered blog at my site (mysite.com/blog) with one installation of WordPress (also at mysite.com/blog) and would like to create a seperate section of my site (mysite.com/newsection) that will also display my blog posts. Please note that I am not trying to create a new category, but an entirely new section of my site which uses parts of the blog.
Ideally, I’d like it to behave just like my original /blog install of WordPress, but only look very different. Templates were the first thing to came to mind, but I have not been able to use them yet because WordPress seems to ignore directions telling it what .php file to use for loading the file.
Here’s what I tried:
I created the different-looking /newsection/index.php template, included the wp-blog-header using
require(../blog/wp-blogheader.php)and so far, so good.
However, the post’s permalink, the category link, and the comments link all load in the /blog/index.php when using permalinks as defined in Options->Permalinks.
For the category links, I have already tried to use
<?php wp_list_cats('file=newcategory.php') ?>to get it to load the request in /newsection/newcategory.php but wp_list_cats seems to completely ignore the file argument. Has anyone else managed to use wp_list_cats or list_cats and successfully load WordPress categories in a page other than /blog/index.php? Am I not using the function properly? According to the Wiki I think I am.
For the post’s permalinks, changing
<?php the_permalink() ?>to
/newsection/index.php?p=<?php the_ID() ?>did work but without using the pretty permalinks.
I’ve been searching these forums and the wiki for some time now and have encountered numerous threads about “using different templates”, but each of these threads has ended in a hack specific to the poster’s needs that won’t work for me.
A hack would do in my case, and I am comfortable enough with PHP to brave hacking a WordPress function but I’d much rather work with the system than against it if there’s any way that I can.
Can anyone offer some insight and/or advice? I think WordPress is great, but am dying to get out of index.php jail!
- The topic ‘Using Templates for New Site Section’ is closed to new replies.