332 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+2 more
dekciw says

So, I’m working on a theme which will have custom post type for galleries/portfolio. And, as this is the first time I’m making a commercial theme, I’m wondering what’s the best way to do it.

I’m stuck at the logic, which way should I create my templates for that cpt.

1. Using has_archive is great, but.. Lets say, I name my cpt ‘portfolio’ then index for that will be sitename.xx/portfolio (and what if someone likes my theme but, lets say, they want to use it for travelling galleries? URL with /portfolio would look weird.)

2. Create cpt with any name, and make page template with custom loop in it for quering those portfolio/gallery items. (This way I could use any permalink (page title) for my portfolio index, but then.. single items would also redirect to sitename.xx/portfolio/singleitem)

So what’s the best way to do it, in case, not to stick to URL defined by default (defined @ cpt registration)?

332 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+2 more
dekciw says

Ok, I’ve might solved that myself ;) Second option with ‘slug’ => ’’ might be a solution, tho, still need to test that out.

332 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+2 more
dekciw says

Ok, it seems I’ve overworked today. :( Still looking for solution.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by