159 posts
  • Bought between 1 and 9 items
  • Europe
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 5 000 and 10 000 dollars
peex says

That is an easy one :)

Just make a category for example “portfolio” and then make a category specific page for it. You can make this with your category id. Let’s say your “portfolio” category id is “6” then you have make a file called “category-6.php” and then you can design it as you wish :) When user clicked on your portfolio category they can see the posts how you want to show.

But there is a problem here. Users can already see your portfolio posts on the homepage or archive pages right? Yeah so what can you do :) Well that is an easy one too. You must exclude your “portfolio” category posts from homepage a.k.a index.php and your archive pages. You can do this with query_posts() function in WordPress.

Simply put this code before the “loop”

<?php if (is_home() || is_archive()) { query_posts(‘cat=-6’); } ?>

This will exclude category 6 which we called “portfolio” from homepage and archive pages.

Check this official WP link for more information on query_posts.

Here is some other useful links for this matter:

http://ifelse.co.uk/archives/2005/04/08/query_posts-redux/

http://codex.wordpress.org/The_Loop

I hope i can help you a little :)

171 posts
  • Sold between 10 000 and 50 000 dollars
  • Referred between 100 and 199 users
  • Bought between 100 and 499 items
  • Has been a member for 5-6 years
  • Exclusive Author
  • United States
clarklab says

Query posts is unbelievably useful. You can use it to complete ditch the loop.

145 posts
  • Bought between 1 and 9 items
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
JJenZz says

I thought this might happen… I am awful at explaining things!

Peex, the solution you have explained is for a problem I am not having. I know how to do what you have explained and have already created a portfolio category for portfolio items.

The difference in my case is that my portfolio is on the homepage, not in it’s own portfolio page. Therefore, the BLOG is NOT on the homepage. However, because wordpress is installed in the root directory all blog links do not contain ”/blog/”.

So, I have a “blog” button in my navigation but all blog entries currently exist at “http://myurl.com/yyyy/mm/dd/blog-post-title” which assumes the blog lives on the hompage. It doesn’t, so I need the URLs to be “http://myurl.com/blog/yyyy/mm/dd/blog-post-title”.

My problem isn’t with the portfolio and portfolio items… It’s simply with the structure of the blog URL .

I did manage to solve the problem though (as explained in a previous post) but am eager to hear of a more efficient solution (if one exists).

159 posts
  • Bought between 1 and 9 items
  • Europe
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 5 000 and 10 000 dollars
peex says

Then i think you must mess with the permalinks in wordpress admin panel :)

145 posts
  • Bought between 1 and 9 items
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
JJenZz says

Yeah, that is what I did :)

Thanks for your help!

by
by
by
by
by
by