2429 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
digitalimpact says

This is close but doesn’t auto-fill category when adding a new post:
add_action('admin_menu', 'register_custom_menu_page');
function register_custom_menu_page() {
   add_menu_page('Portfolio', 'Portfolio', 'edit_posts', 'edit.php?category_name=portfolio', '', '', 6);
}
http://wordpress.org/support/topic/auto-check-category
2 posts
  • Bought between 10 and 49 items
  • Has been a member for 4-5 years
  • United States
dmvieira says

What an interesting thread! Thanks to everyone who chimed in and contributed info. I am currently developing my first theme that I plan to sell through TF and I was going to include shortcodes just because everyone else does... I think I will leave them out, but I hope that decision doesn’t strike against me in the reviewing process.

Actually, i feel like i want to leave out a lot of the crazy bells and whistles that you see in a lot the premium themes…(thousands of fonts, multiple sliders, unlimited this or that, ect…). For the design, i am leaning towards a simple, NOT overly designed site, but has flexibility through the theme options panel. Things like turning sections on or off or choosing which categories to display and how many. I figure that most of the themes that get purchased, a designer/developer ends up using it as a base and redesigns it anyway. I’d just rather give them something simple to work with.

Hopefully my theme will be accepted : )

900 posts
  • Sold between 1 000 and 5 000 dollars
  • Most Wanted Bounty Winner
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • Microlancer Beta Tester
  • Serbia
  • Exclusive Author
aleluja says

^ same. Thanks guys for such an awesome thread.

576 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

I use custom post types to create lots of functions, sometimes even if it are only back-end functions. CPT’s offer so many options for handling content, even content not meant to be shown in the frontend.

Custom post types is one of the main reasons why WordPress has grown so much and you could almost do anything with them – so why not use them? I don’t see the problem. I see a theme as a platform to also create functionality, not only design.

If a theme is created with certain EXTRA functions and features that uses custom post types it’s not the theme developers responsibility to keep everything working when a users switches theme – EXCEPT for standard WordPress features ofcourse! Standard WordPress features should always work in any theme. For example a nice fullscreen photography theme with all it’s options and galleries and background slideshows – ofcourse something like that doesn’t work if a user just switches to another theme.

To summup: Standard WordPress features: Always keep compatible – Extra functionality: That’s where a theme is created for.

158 posts
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 1 000 and 5 000 dollars
  • United States
greenshady says

Custom post types is one of the main reasons why WordPress has grown so much and you could almost do anything with them – so why not use them? I don’t see the problem.

I love post types. I’m the guy who wrote one of the most popular post type tutorials on the Web. I wrote the chapter on them in one of the most popular WordPress development books around. It’s rare to find someone who loves post types and uses them for various functionalities than me.

However, post types were never (and still are not) intended to be registered within themes.

The “problem” that you don’t see is that themes should not define the generation of user content. They’re intended to define the presentation of user content.

When the theme defines the generation of that content, you get what we call the “lock-in effect,” which means that the user cannot change their design (i.e., theme) without losing their content. If you don’t see a problem with that, there’s no point in continuing this conversation.

WordPress is really good about separating these things out. That’s why we have separate plugin and theme systems. Themes are separate from plugins so that users can change their design without losing any of the important stuff like their content.


I see a theme as a platform to also create functionality, not only design.

That’s not what themes are for. Themes are for defining the presentation of user content. That’s their purpose within the scope of the WordPress platform. It’s not a matter of opinion. That’s simply what themes are.

900 posts
  • Sold between 1 000 and 5 000 dollars
  • Most Wanted Bounty Winner
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • Microlancer Beta Tester
  • Serbia
  • Exclusive Author
aleluja says

The problem about this on themeforest is that many authors see themes as complete websites. That would be ok if you tell your buyers never to change a theme or not to use plugins. But users do change themes and do use plugins and you must tell yourself that themes are not websites, they are just themes.

576 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

I totaly ‘see’ the explanation greenshady is making,

But, maybe it was not the first intention but it sureley has evolved that way. A theme provides a functions.php, where you can use all hooks, filters and functions like in plugins.

Also, even the WordPress codex suggests you can you functions like the register post type inside your theme files – Wordpress does not supply a functions.php for nothing. Also the template structure WordPress created to use custom post types is one of the many things that suggests a theme can also provide functionality.

It’s not against WordPress rules to use given possibilities to create functionality inside a theme without the use of plugins – they even suggest it sometimes.

So therefor: a theme IS also a way to create functionality – they provide the options, so i use them.

It would be a total different story when WordPress everywhere would say it’s not to be used inside a theme.

Besides that, even if you we’re using a plugin to create the post type functionality, most themes will still use the template structure to display it. Yes, it could be done with things like template redirect etc, but again – WordPress does not have that template structure for nothing. So another theme will need those template files, which ofcourse a new theme will not have.

I think it’s more a matter of personal philosofy

322 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Sold between 50 000 and 100 000 dollars
  • United Kingdom
PaulWinslow says

I totaly ‘see’ the explanation greenshady is making,

But, maybe it was not the first intention but it sureley has evolved that way. A theme provides a functions.php, where you can use all hooks, filters and functions like in plugins.

Also, even the WordPress codex suggests you can you functions like the register post type inside your theme files – Wordpress does not supply a functions.php for nothing. Also the template structure WordPress created to use custom post types is one of the many things that suggests a theme can also provide functionality.

It’s not against WordPress rules to use given possibilities to create functionality inside a theme without the use of plugins – they even suggest it sometimes.

So therefor: a theme IS also a way to create functionality – they provide the options, so i use them.

It would be a total different story when WordPress everywhere would say it’s not to be used inside a theme.

Besides that, even if you we’re using a plugin to create the post type functionality, most themes will still use the template structure to display it. Yes, it could be done with things like template redirect etc, but again – WordPress does not have that template structure for nothing. So another theme will need those template files, which ofcourse a new theme will not have.

I think it’s more a matter of personal philosofy

Presentation Vs. Functionality: Since the purpose of Themes is to define the presentation of user content, Themes must not be used to define the generation of user content, or to define Theme-independent site options or functionality. - http://codex.wordpress.org/Theme_Review

As Justin has already said – this is not a matter of opinion. This is what it is. It’s right there in black-and-white.

You mentioned that somewhere in the codex gives you the green light to register post-types in your theme, but have you considered the distinction between providing a service for your client and selling products on a marketplace? Services & products are two very different things.

576 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
ChapterThemes says

Presentation Vs. Functionality: Since the purpose of Themes is to define the presentation of user content, Themes must not be used to define the generation of user content, or to define Theme-independent site options or functionality. - http://codex.wordpress.org/Theme_Review

As Justin has already said – this is not a matter of opinion. This is what it is. It’s right there in black-and-white.

You mentioned that somewhere in the codex gives you the green light to register post-types in your theme, but have you considered the distinction between providing a service for your client and selling products on a marketplace? Services & products are two very different things.

Well first of all those are rules for themes submitted to the WordPress Theme Directory. They are not stated as general rules for every theme. Also it means “Theme-independent site options or functionality” – so a portfolio theme using a custom post type to create a portfolio, which the theme depends on to show in the frontend: is not bad practice.

Now the following: There are plenty ( PLENTY ) themes INSIDE the WordPress Theme Directory that use Custom Post Types. Also those CPT’s are NOT created by included plugins. The ONLY difference is that the code which is creating the post type, is not directly inside the functions.php file but in a separate file – which in turn is required once inside the functions.php file.

So saying that the creation of custom post types INSIDE themes is bad practice is really just NOT true.

If it’s a debate about whether it’s going directly inside the functions.php file, or included through a separate file – then this must be the most overdebated thing ever.

If even WordPress approves themes in their WordPress Theme Directory which creates and use custom posto types ( and a lot more ) inside the theme, than sure as whatever it’s not a bad thing to do per ce, and therefor: Still a matter of personal philosofy.

Say if someone creates a portfolio post type and some functions as a plugin and includes that inside their theme. The theme has all the necessary template files to present the portfolio. Now a user switches theme and they keep the plugin active – they still have no portfolio at the frontend and need to customize or create a template. So much for forward compatibility of using a plugin. YES: the backend functions keep intact – but still at least 60% ( i think even more but lets say 60 ) of the buyers here do not know how to do that – so they are still stuck.

I now know even more than ever that using custom post types inside a theme is not bad practice. The way you do it code-technically is a different thing.

900 posts
  • Sold between 1 000 and 5 000 dollars
  • Most Wanted Bounty Winner
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • Microlancer Beta Tester
  • Serbia
  • Exclusive Author
aleluja says

Content is the king. If you can’t access it then screw it.

by
by
by
by
by
by