I have been away for 8 days holidaying in Greece but am now home and looking forward to getting stuck back into converting my first ever WordPress theme. One problem though… the theme I have started trying to integrate includes a portfolio and a blog section and I would like both to be controlled by WordPress.
So far, I can’t figure out if this is possible. The portfolio is on the homepage and I would like the blog to be at ‘www.myurl.com/blog/yyyy/mm/dd/blog-post-title/’ but all blog posts are currently accessed via ‘www.myurl.com/yyyy/mm/dd/blog-post-title/’ (without the ’/blog/’ ) because of the portfolio items.
The portfolio items are blog posts in a portfolio category so they need to be accessible from the homepage but I would like the URL for posts in my blog section to contain ’/blog/’.
I could use a .htaccess file but wasn’t sure if this is a good idea when releasing a theme to the public. Any advice on this? Is this possible? Am I even making sense? lol
Any help on this would be greatly appreciated
This isn’t looking very promising! No one has any idea how to do this?
I may have to make it a portfolio theme only but that’d be a bummer since my heart was set on making it do both!
I’m assuming you know how to separate the Portfolio & Blog posts, and have separate layouts for them?
As for keeping /blog/ for blog posts, you could try including all Blog categories under one main ‘Blog’ category.
However I’m not sure if sub-categories display in URLs.
- Category 1
- Another Category
- etc. etc.
Hope that helps somewhat.
I have solved this but it might not be the most efficient way to do it. This is what I did:
1) In ‘WordPress settings > Permalinks’ I selected ‘Custom structure’ and entered the following: ’/blog/ year / monthnum / day / postname /’
2) I created a file named blog.php and added the ‘Template name: Blog’ comment to the top of the file.
3) I created a new page in WordPress called Blog and selected the Blog file as the ‘Page Template’.
And that was it! I had to add some extra ‘is_single()’ and ‘is_category()’ checks for my main navigation in order to have the ‘blog’ button highlighted when viewing single posts or categories, but so far so good. Everything seems to be running smoothly.
This is going to be a bit of a pain to explain to potential customers but I haven’t managed to come up with a more efficient solution yet. If you have any better ideas please do let me know!
Ah, it’s removed my percent signs from my custom URL structure. Oh well.
Dan – Yes, I already have my portfolio items separated in their own category so differentiating between portfolio items and blog posts isn’t a problem.
Thanks for your suggestion… I’ll give that a try and see if it is easier!
Wow, spamming my own topic here
I just tried your solution (danharper) and the first roadblock i’ve hit is the way that WordPress structures the category URLs. Using your method, all category URLs look as follows:
You can customise the ‘category’ bit in WordPress settings but it doesn’t look as though you can remove it.
Nevermind… my original solution (as long winded as it is) seems to work fine.
Thank you for your help danharper!
Wow, spamming my own topic here
Haha, I just made a double post in another thread and though ‘oh I wonder if they frown upon that around here?’ I think its totally fair game as long as you have something new to add.
Some places get so bent out of shape about it.
Cant wait to see your final product! I just submitted a project just like this for approval (crosses fingers)
You did? Ooooh, how did you handle the portfolio and blog side by side with WordPress? Will be interesting to hear your solution to this!
As for my theme, it’s nothing new… I’ve just been converting my NightMedia template into a WordPress theme (and have added a blog section obviously).
Very nice. Your ‘NightMedia’ theme was the first one I bought on this site, cant wait for a wordpress theme of it
You can accomplish that a few different ways actually, you can create extra theme files, load them as categories and everything else as sub categories, etc…