I want to create a custom page that has tournament brackets instead of the usual content. I have read some of the WordPress documentation and found how plugins work and how I add admin pages to administer the page.
What is needed to create the page itself (and have it listed on the site)? Do I need to create a custom template that has the majority of the work in it? Do I need to have the plugin create the page or where do I start?
Also, how do template pages and plugins interoperate? Does WordPress provide me a reference variable to the plugin or do I have to load it “manually”?
I think I’ll reformulate my question. While the answers have been helpful, they aren’t exactly what I’ve been looking for.
Basically, I want a page where I have some module / code / whatever that controls whatever goes on there. This means I can’t just set up a page since then I can only fill in text. I need a page where I can decide what happens when I go to that page, what is written, submits, etc. I am fairly fluent in PHP, just not WordPress 🙂
The second part is the admin, where I need a page (or several) to control some of the administration stuff of said page.
So far answers I’ve seen are overtly complex. What you should do is simply this:
In WordPress, create a new page; title it “example” – note the slug it generates. It should be “example” as well, mimicking the title.
Create a file in your active theme called page-example.php – mirroring that slug.
Sandwich your custom PHP with bare-bones HTML code in page-example.php:
Depending on your page, you may need to recreate a few div elements, and possibly toss in a get_sidebar().
Once a plugin is activated, you can use it from any new page.
If I were you, I would encapsulate the logic to show the information for the tournament bracket in a plugin. Then I would create a template page specific for the page you need.
You can create a new page with a custom template just the same way you create any page, and choosing a custom template on WordPress’ menu. If you followed the standard page template system in WordPress, the template will appear in the “templates” menu.
Use Custom Post Type and Custom Taxonomies
You want to look at Custom Post Types and Custom Taxonomies. (see this answer I gave on a very similar subject).
Example Code for your Company’s Post Type and Taxonomies
With WordPress 3.0 you can create a
company
custom post type and then one or more custom taxonomies that apply to the company such as category, funding and status. To bootstrap your efforts here’s code you can drop in to your theme’sfunctions.php
file to get your started:Other Post Types you might want:
If you really want to clone Crunchbase you’d be wanting to create custom post types for each of these (though I’m guess you want something similar, but for a different market?):
Company Listing Page
For your company’s listing page (like this one on Crunchbase) I’d probably create a WordPress “Page” called “Companies” (imagine that!) and then use a post list shortcode plugin like List Pages Shortcode (if you use that one you will need to make a one-line modification to support Custom Post Types like I show here.)
With that plugin and modification you can add the following text to your “Companies” Page and it will list out all the companies in a bulleted list on that page which you can style with CSS:
Company Specific Layouts
Then for a custom layout for each company you can make a copy of the theme template file
single.php
and name itsingle-company.php
and make whatever modifications you want to the layout there.User Company Submissions
And if you want to let people submit companies consider using Gravity Forms (not an affiliate link; US$39 per site license and worth every penny.)
This is an answer I wrote about cloning Crunchbase over on WordPress Development. It’s not written with your question exactly in mind, but it should be so close that I don’t think I need to modify it for you to understand how to apply it.
Depending on your exact needs, a plugin might be overkill unless your wanting to provide it for consumption on the net as well. It would definitely be a little more useful as far as separating the login from the template goes, but for personal use it might end up being more work in order to do something that could be handled just as easily by built in functions.
Something like this is exactly what the newer “Custom Post Types” in WordPress 3.0+ are built for. Using the new functions you can pretty easily build custom submit forms, and these type of submissions are kept out of the main loop by default, so that content is already separated away from normal blog posts. You can add your specific functions into the default functions.php WordPress uses, or separate it out and just include it manually without having to worry about all the hooks and action calls a “plugin” generally requires.
Using a mix of custom post types and templated pages should be just as useful for you as a full blown plugin, and require less overall WordPress knowledge to implement. I highly suggest checking out what Custom Post Types have to offer, the following links should be useful in getting you started: