Jump to content
Sign in to follow this  
johnny_n

Template for custom post type archive

Recommended Posts

johnny_n

What's the best way with PP to assign the "Custom Page" template to a custom post type archive page?

Share this post


Link to post
Share on other sites
catrina
The code for the post type archive page will need to be edited, I believe. There is a tutorial on how to create a custom post type archive page here: http://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-post-types-archive-page-in-wordpress/. The setup is a little different because PlatformPro's templates differ from typical WordPress templates.

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
johnny_n
"The setup is a little different because PlatformPro's templates differ from typical WordPress templates." Yes, that's the question. Is there a hook which creates a pagelines page that I can use in a .php file to create a template and save the way I would in a regular wordpress theme?

Share this post


Link to post
Share on other sites
catrina
There have been posts in the past about success with this Custom Post Type plugin: http://wordpress.org/extend/plugins/custom-post-type-ui

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
johnny_n
Thanks catrina -- I've registered the post types in my functions.php file and Platform Pro automatically does what it should which is to display the default archive template for those listings so no plugin necessary. The default archive template is fine for categories, tags, dates, etc. but I want to assign a different archive page template to a couple of custom post types, i.e. the "custom page" template I've created in PlatformPro... This would be pretty easy in a "traditional" theme, as your link above shows, but I just don't know the most effective way to do it in Platform Pro. It looks more and more like there might not be an effective way -- maybe I just have to create the template using your hooks list: http://www.pagelines.com/forum/discussion/6833/diagram-visual-reference-for-hooks/p1

Share this post


Link to post
Share on other sites
johnny_n
Let me approach this from the other direction -- the reason i want to use the "custom page" template is I want to remove the sidebars and add the "morefoot" section above the footer. What's the best way to do this in an archive page in PP? I'm not seeing hooks which can add/remove sections of the page (sidebars, etc.) only hooks which can add to what's already there... is this true?

Share this post


Link to post
Share on other sites
Kate
The easiest way to do that would to just hide them with CSS, for example: [code].archive #morefoot{display:none;}[/code] Note that those sections will still load, but are being "hidden" with CSS.

Share this post


Link to post
Share on other sites
johnny_n
Thanks, Kate -- this gets me halfway there, but I'm still surprised there's no way to create a custom page with just code. This seems like a pretty big omission - I can see problems trying to wrap pagelines around plugins which create their own pages. But maybe I'm missing something here. So I can hide the sidebars conditionally on those pages: [code].archive.post-type-archive-bios #sidebar1{display:none;}[/code] But what about making the morefoot visible? That doesn't seem to work with css.

Share this post


Link to post
Share on other sites
Rob
Johnny, I'm confused. On one hand you said you wanted to hide the morefoot, and now you want to show it? Did you add the code provided by Kate to your Custom Code > Custom CSS? Would deleting that line help? Perhaps if this is complex, you should consider the services of one of our Pros? http://www.pagelines.com/pros

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
johnny_n
@rangelone -- I never said I wanted to hide it, Kate misunderstood. This is what I said: [quote]"the reason i want to use the "custom page" template is I want to remove the sidebars and add the "morefoot" section above the footer"[/quote] I did add a modified version of the code Kate suggested and even posted that modified version here in case someone would find it useful because it does what I needed, as opposed to what Kate suggested. [edited]

Share this post


Link to post
Share on other sites
Rob
I apologize for my confusion.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
johnny_n
No problem. I think what I'm going to add the morefoot to all pages and remove it with css on most other pages -- I'll go backwards. Without a better suggestion that's the only way I can think of... it'll increase page load time, etc. so I'm not particularly excited about it but I don't see another solution.

Share this post


Link to post
Share on other sites
Rob
I think everyone's been trying to help you and would strongly suggest you click "Thanks", if only for their efforts on your behalf, even if the answers are not what you hope for. Sometimes the way clients describe their requirements, it is difficult for us to provide solutions. Most of us work in short gaps of an hour or two, several days a week and have to reply to dozens of complex issues. The greater clarity the client provides, the easier it is for us to provide a sound and workable reply. Perhaps she misunderstood your statements as I did, but we (mostly Kate and Catrina) tried to help.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
johnny_n
I didn't click "Thanks" but two out of three times above my first word was "Thanks". I think the thought of thanking someone, typing it out, should be worth a little more than clicking a little button that we're told to click. This is my first effort on the forums here and my first experience with a forum that has a "Thanks" button. I have just now thanked all of you, thank you all very much, but I must admit it's kind of odd to be reprimanded on etiquette when I've been very polite and clear on what I am trying to accomplish. This is a fundamental question about how Platform Pro creates templates and is relevant to many people because like I said above, how does one wrap Platform Pro around any sort of page generated by a plugin? We're instructed to post to the forums for help, so this is the place I'm supposed to be but I still haven't received an answer to my question. I understand the workload must be overwhelming, in fact I'm afraid it's rather obvious, but I don't see how I've done anything wrong here. If I have I apologize.

Share this post


Link to post
Share on other sites
kastelic
Hi, The CSS hiding trick is the only way that I know of to have different sections appear on different posts pages. You can add other content by using an if statement in functions.php. Here's an example that adds some code in a custom post type archive. [code] add_action('pagelines_inside_top_theloop', 'hotel_info'); function hotel_info(){ if( (get_post_type() == 'hotels') && (is_archive()) ) { //php code here } } [/code] And yet another way is to create a page template via the normal Pagelines method http://www.pagelines.com/docs/custom-sections (or use an existing one) and output your own loop using this handy shortcode function: http://www.wprecipes.com/wordpress-shortcode-display-the-loop Hope this helps.

Share this post


Link to post
Share on other sites
johnny_n
How to create a custom post type template is in this thread: http://www.pagelines.com/forum/discussion/12311/how-to-make-custom-page-templates

Share this post


Link to post
Share on other sites
Danny
Thanks Johnny_n, I forgot I wrote that wall text :D

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
newsmanatl
The vague reprimand, accompanied by an outright request for "thanks," is entirely unprofessional and inappropriate. People pay for this product, in part because of boasts that it is simple to learn (it's not), that it is easily reconfigured (again, it's not) and that Pagelines offers excellent customer support (that's debatable). Frankly, your personal problems are not of any concern to customers and shouldn't even be mentioned. If this is your job, treat it like a job and don't shift the burden back to the user. Are we supposed to shed a tear that you spent so much of your time trying to help this poor schmuck who, like many of us, was probably sucked into buying PlatformPro based on the preposterously false claim that it was fabulously, wonderfully easy? Like the guy said, thanks. I have some words to follow that, but I'll keep them to myself.
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×