Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

How does Atahualpa distinguish static pages?


  #1  
Old Jan 3, 2011, 06:28 AM
webalyst's Avatar
webalyst
 
82 posts · Nov 2010
London, UK
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  
Old Jan 3, 2011, 08:02 AM
juggledad's Avatar
juggledad
 
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  
Old Jan 3, 2011, 09:22 AM
webalyst's Avatar
webalyst
 
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  
Old Jan 3, 2011, 11:00 AM
juggledad's Avatar
juggledad
 
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  
Old Jan 3, 2011, 11:34 AM
webalyst's Avatar
webalyst
 
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  
Old Jan 3, 2011, 11:40 AM
juggledad's Avatar
juggledad
 
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
  #7  
Old Jan 3, 2011, 12:42 PM
webalyst's Avatar
webalyst
 
82 posts · Nov 2010
London, UK
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
  #8  
Old Jan 3, 2011, 02:42 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Jan 3, 2011, 04:24 PM
webalyst's Avatar
webalyst
 
82 posts · Nov 2010
London, UK
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

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating new page templates for static pages Englishbydesign9 Atahualpa 3 Wordpress theme 1 Nov 1, 2010 06:32 PM
Also my static pages will not load taal Center area post/pages 5 Jan 14, 2010 10:35 AM
How to add static pages to RSS feed Larry RSS, Feeds & Subscribing 1 Dec 3, 2009 05:33 AM
How to make work static pages snarunas Page & Category Menu Bars 1 Oct 11, 2009 09:16 AM
Static pages with category posts? mcphoto Atahualpa 3 Wordpress theme 3 Apr 25, 2009 09:48 AM


All times are GMT -6. The time now is 02:12 AM.


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