Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   How does Atahualpa distinguish static pages? (http://forum.bytesforall.com/showthread.php?t=11980)

webalyst Jan 3, 2011 06:28 AM

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

juggledad Jan 3, 2011 08:02 AM

you should truck on over to codex.wordpress.org and do some reading on Pages

webalyst Jan 3, 2011 09:22 AM

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.

juggledad Jan 3, 2011 11:00 AM

each page can be identified by the class 'page' that is assigned to <body>

webalyst Jan 3, 2011 11:34 AM

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

juggledad Jan 3, 2011 11:40 AM

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)

webalyst Jan 3, 2011 12:42 PM

I don't think you have understood my question. Based on what you just posted it is: how to get is_page() to return true for my custom post type!

Thanks

juggledad Jan 3, 2011 02:42 PM

Ok I guess I misunderstood your question. There is no built in support for custom post types in atahualpa. If you are writing a plugin to use them, then you need to provide the code/queries to access the info you want to use. If you want atahualpa to display them, then it looks like you need to create a page template for them. If you want the backend to display a customized G.U.I. For that post type, you need to provide it.

There is a lot of info out on the web that could help you, but honestly writing a plugin is not a subject for this forum :(

webalyst Jan 3, 2011 04:24 PM

I'm sorry it was off topic - which lead to the confusion - which is still there! As I explained, I don't want to customise the template, so I was asking here because I thought people who understood how templates worked might understand how to make a custom post type behave like a page rather than a post. Now I see that this is probably more deeply under the hood, so I am a bit wiser about where to look.

Thanks for trying to help, especially as I was off topic.

Mark


All times are GMT -6. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.