In WordPress's custom post types what does the public argument do/represent?
-
I started with this: http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress. No doubt Justin is the WP man. But scroll down a bit, please. It's not clear what exactly public does. Or what not-public is? Is the attachments post type public=>false? As a side note I'm wanting to develop some code (read: plugin or shortcode) that is able to use conditional tags and such to fine tune what's displayed. For example, if it's page X display image X. If it's category Y disply image Y. If it's tag Z then display image Z. In theory it doesn't seem too difficult. However... What I can't seem to wrap my head around is customer post types. Maybe I'm over-thinking it? In terms of structure and WP functions, etc. are they just the same as builtin post types? I'm just trying to anticipate - as based on the structure - any type of output pages...interpret that page...and then display the image that was related to that page type. (I'm using page universally, and not being specific to WP pages. Tho' I need to interpret those as well.) Any thoughts and/or links would be appreciated, thanks.
-
Answer:
The Public flag is used to determine whether the post type should be shown in the admin UI. On your other point: It depends where you want to display your picture. But as long as a theme calls body_tag() in the body tag, then you can, for instance, hook a background image based on one of the many classes that will be added to the page, there will be a class for category-slug, tag-sug, page-tag, etc. See http://codex.wordpress.org/Function_Reference/body_class
Mike Little at Quora Visit the source
Related Q & A:
- What are the public schools in Portland?Best solution by Yahoo! Answers
- What are some public acting and film schools?Best solution by american-school-search.com
- What is a public option in the health care debate?Best solution by Yahoo! Answers
- What is a good tattoo to represent becoming a mother?Best solution by Yahoo! Answers
- What is a public health major?Best solution by sph.washington.edu
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.