|
#1
Jan 3, 2011, 06:28 AM
|
|
|
|
82 posts · Nov 2010
London, UK
|
|
How does Atahualpa distinguish static pages?
I am writing a simple e-commerce plugin (for Google checkout) using a WP3.1RC-1 custom post type to describe each 'product'.
I want these post types to be treated by default, more like a static page than a blog post, not just in Atahualpa but in general in any theme so I'm interested to know:
1) How Atahualpa (and themes in general) determine how to display a post as a static page (as opposed to a post)?
2) Is there a way, which is not theme dependent, to cause my custom post type to be treated like a static page when formatted?
Thanks
Mark
|
#2
Jan 3, 2011, 08:02 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
you should truck on over to codex.wordpress.org and do some reading on Pages
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#3
Jan 3, 2011, 09:22 AM
|
|
|
|
82 posts · Nov 2010
London, UK
|
|
I've already been reading about this, but so far have not found what I need. Its generally assumed this is going to be done in the theme (e.g. with single-custom_post_type.php) which is not very useful when a plugin is adding its own custom post type.
|
#4
Jan 3, 2011, 11:00 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
each page can be identified by the class 'page' that is assigned to <body>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#5
Jan 3, 2011, 11:34 AM
|
|
|
|
82 posts · Nov 2010
London, UK
|
|
thanks, but I don't understand this. possibly because I don't understand WP very well yet, so I need more info. Here's my understanding of what you are saying (please correct!)..
1) <body> can have <body class='page'>
2) I can somehow cause this to be set for my custom post type (how?!)
3) This will somehow cause any WP template to display my custom post type as it would any static page.
I don't get how 3) can be so. I'm assuming that a template somewhere does "is_post()" or something and generates different HTML elements for a post than a static page (e.g. author, comments for post but not for page). I don't see how setting an attribute on <body> will affect the structure of the output (while obviously it will affect any styles).
Please can you clarify - have I have misunderstood you?
BTW I went back to look deeper into the codex and still no joy. I've posted to the forum there too so if I find the answer I'll post it here.
Mark
|
#6
Jan 3, 2011, 11:40 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
ok, so you want to know how to tell if wordpress is processing a 'page' There is a conditional 'is_page()' that you can use (see http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
|