The Power Of Custom Types John Havlik

Slides:



Advertisements
Similar presentations
WordPress Installation for Beginners Sheila Bergman
Advertisements

Deconstructing the Loop AL DAVIS WPTEACH.COM
Improving Your WordPress Productivity July 24, 2011.
Wordpress Theme Hacks Nearly Anyone Can Do Afraid you might "break something" by mucking around in your theme? With a little determination, and just a.
STAY CALM Custom Post Types Smell Your Fear. WHO AM I? Christine the designer, coder, and WordPress Specialist doesnt sound as good. Yes! This presentation.
Wordpress Workshop 101 Presented by Will Hardison.
WordPress Themes.
@beckyddesign Beckydavisdesign.com Take Control of Your Site with WordPress.
Greg Sennema library.wlu.ca/blogs/technolibrarian Library Blogs using WordPress Greg Sennema Electronic Services Librarian Wilfrid Laurier University Session.
Blogging 102 Getting Customized!. Choosing your theme A WordPress Theme is the design of your blog. Much like every magazine has its own unique design,
John Havlik WordPress user since 2005 Plugin developer since 2006 Breadcrumb NavXT (~600k downloads) Administrator for Weblogs.us WordPress.
WordPress from Start to Finish Day 3: Working with plugins (
Getting Started with WordPress David Grogan
Web Site Integration using WordPress MySql A presentation (that should have been made) to WordPress Meetup By Peter Mantos; Mantos I.T.Consulting, Inc.
WordPress from Start to Finish Day 1: Installing and Using WordPress Looking at the WordPress database.
Moving stuff around on your Drupal web pages Alex Bergin / Dept. Agriculture &
Wordpress. Background Content Management System Why we use it How it works – PHP – MySQL.
Using WordPress as a Streamlined CMS More than just a blogging platform Case study of PMCoursefinder.ch.
USING WORDPRESS. WEEK 1 1.Why WP? 2.Setting Up WP 3.Exploring the Admin screen 4.Page Organization 5.Posting 6.Polls.
WI.org Site Training Laura Peterson 3/31/2014.
Politics 2.0 Changing the country thru WP & BP. What I’ll cover What we are doing – For everyone Why we choose WordPress & BuddyPress – For people looking.
{ OER Management Made Easy …or so I thought. joe hobson / Navigation North.
Help the users find what they need using the Search Speaker: Frédérique Harmsze 15 th November 2014 Host: Matthew Hughes.
Introduction to WordPress. Learning Outcomes Describe WordPress Compare and contrast the difference between a WordPress hosted blog and a hosted blog.
WORDPRESS WEBSITE WORKSHOP Part 1: Building a Web Presence with WordPress Karen & Brad Trivers (902)
Seattle Drupal Clinic Introduction to Drupal and Web Content Management.
Wordpress as a content management system Building a better website with content management systems | June 12, 2009.
Content Management, Working with WordPress Svetlin Nakov Telerik Corporation
UWWD In our quest to eliminate bad websites, we present…. HALLELUJAH!!
PROJECT 3: E-PORTFOLIO PHASE 1. WHAT IS AN E-PORTFOLIO? “An e-portfolio, also known as electronic portfolio, digital portfolio, or electronic resume,
Jiří Balej, Martin Podborský, Petra Čačková.  Tools, which enables to produce content without source code knowledge  Text document ◦ MS Word/OO Writer.
What is Wordpress?  WordPress has a web template processor. Users can re-arrange widgets without editing PHP of HTML code; they can also install and.
Wordpress Tutorial 22 – 24 April Table of Contents Introduction Designing blog Writing and Publishing blog Pages Posts Categories Tags Links Comments.
Bones – HTML5 Wordpress Theme Development
The Dr ü G Book: An Intro to Drupal The Dr ü G Book: An Intro to Drupal (Dr ü G: Drupal User ’ s Group - users, not developers) This is an introduction.
USER MANUAL USER MANUAL 19 July TABLE OF CONTENTS System Description5 How It Works?6 Maxxbooking Plugin7-8 Hotel Info & Description10 Hotel Details11.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
Launch Your WordPress site in One Hour By Bret Phillips For slides, codes, and notes: Web Devils WordPress.
What Every WordPress User Should Know By: Anthony Montalbano & John Pratt (JTPratt Media)
WordPress Web. WordPress Blogging system with full content management Personal publishing system Built on PHP scripting language and MySQL relational.
Part 2: How to create blogs In Modified by: Mr Rizal Arbain.
What is Drupal? Open Source software written in php. A CMS or content-management system. A sophisticated web application building tool.
WordPress ® in simple terms WordPress is a free and open source blogging tool and a content-management system (CMS) based on PHP and MySQL, which runs.
WordPress Fast Track. What Is WordPress? Learn what WordPress is Know why WordPress is a popular tool in making websites and blogs Discover some of the.
WordPress Plugin Development A Starter Guide For Beginners.
Mary Immaculate College 9 th Nov. Objectives Participants will be enabled to: Create and maintain your school’s website using Scoilnet Blogs Add other.
Seattle Drupal Clinic Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology.
WikiPlus Configurations Configure WikiPlus elements to your needs.
Scott Voth GSLIS 747 – Queens College. Posts vs. Pages “Posts” Blog entries Dynamic Date Driven Archived Comments Trackbacks Can be Syndicated - RSS Pages.
…for beginners Class #2. Reminders Tues 7/21, 7/28, 8/4: 7-9:30pm at CMU 243 (UW) WiFi (UW) user: event0960, pass: aEBk_uYXf_uUMm class website (new slides!):
How EPA/ORD Moved to Drupal 7 Jessica Dearie U.S. EPA, Office of Research and Development Office of Science Information Management.
Here are some things you can do while you wait 1.Open your omeka.net site in your browser (e.g. 2.Open.
Drupal Basics for Content Managers: Editing my Drupal Website Drupal Basics for Content Managers: Editing my Drupal Website Cynthia Mijares,
Learn What’s New in WordPress4.0 Presented by: SunTecOSS.
Drupal Basics May 30, 2012 By Sean Fitzpatrick. Sean Fitzpatrick | Welcome We're going to talk about Drupal We're going to keep it pretty.
WordPress Vs Joomla Vs Drupal 2015 – Which One Suits Your Business?
Views: From the Beginning John Fiala Twitter: jcfiala Vintage Digital.
Introduction To Simple WordPress Plugin Development
Intro to WordPress (Using XAMPP)
What is a Blog? short for Weblog journal on a website
WordPress Plugins Popular WP Plugins: Sliders, Forms, Contacts, SEO, Forum, Photo Gallery, e-Commerce WordPress Plugins SoftUni Team Technical Trainers.
WordPress Development
WordPress Plugins.
Easy Way to Improve Your 404 Page Template in Wordpress If you want to improve your 404 error page. So we are here to explain to you how to improve your.
Many North American countries asked us a way to produce a responsive slider with Soliloquy in WordPress? If you would like to grasp, then you're on the.
Samer Koda IEEE-SEM – Section Student Representative IEEE-SEM-SA – Webmaster 12/7/2018.
WordPress Development
How to Maintain Your ARS Websites
WordPress Portfolio Plugin Know More About WordPress Portfolio Plugin.
WordPress Development
Presentation transcript:

The Power Of Custom Types John Havlik

About Me WordPress user since 2005 Plugin Developer since 2006 – Breadcrumb NavXT (~875k downloads) Admin for weblogs.us Personal site: mtekk.us

Agenda Motivation CPTs Taxonomies CPTs vs Taxonomies vs Meta vs Others Showcase

The Problem Creating a site with a portfolio – Using categories to separate portfolio projects from news/blog posts – End up using hidden categories and other hacks Everything breaks (plugins in particular)

USE A CUSTOM POST TYPE The solution

Whats a CPT? Custom Post Types (CPTs) are content types you define Come in 2 flavors – Hierarchical – Flat

Whos Using CPTs? bbPress 2.0+ Meteor Slides WP e-Commerce (GetShopped) Many more

How to Create a CPT Use register_post_type($post_type, $args); – $post_type is the unique post type name – $args is the array of arguments to customize the CPT Call using a hook into the init action Do this in a plugin – functions.php is not portable between themes

Example Code add_action('init','create_my_project'); function create_my_project() { register_post_type('mtekk_project', array( 'labels' => array( 'name' => __('Projects'), 'singular_name' => __('Project') ), 'public' => true, 'has_archive' => true) ); }

Naming Your CPT Make it unique – BAD: project – GOOD: mtekk_project Max length of 20 characters NO: – s p a c e s – UPPERCASE – wp_ prefix

The $args Key attributes to investigate: – labels – array of labels for the CPT – show_ui – capabilities – array of permissions – supports – array of features in the edit page – rewrite – array of rewrite arguments – hierarchical Checkout the Codex for more info: register_post_type

More Complex Example

An Easier Way Custom Post Type UI – type-ui

Displaying CPTs Templates for the frontend: – single-{posttype}.php (since 3.0) – archive-{posttype}.php (since 3.1) Custom WP_Query instance: – $projects = new WP_Query(array(post_type => mtekk_project, posts_per_page => 10)); – while($projects->have_posts){$projects->the_post(); /*your code here*/} – Can use this anywhere – Can use get_posts() wrapper for WP_Query

TAXONOMIES Organize all the things with

Whats a Taxonomy? Taxonomies are a way to classify/organize content (post) types. Come in 2 flavors – Hierarchical – Flat

How to Create a Taxonomy Use register_taxonomy($taxonomy, $object_type, $args); – $taxonomy is the unique taxonomy name – $object_type array of post types that this taxonomy can be used on – $args is the array of arguments to customize the taxonomy Checkout the Codex for info on $args _taxonomy Call using a hook into the init action Do this in a plugin – functions.php is not portable between themes

Example Code add_action('init','create_my_medium'); function create_my_medium() { register_taxonomy('mtekk_medium', array('mtekk_project'), array( 'labels' => array( 'name' => __('Mediums'), 'singular_name' => __('Medium') ), 'public' => true) ); }

Naming Your Taxonomy Make it unique – BAD: medium – GOOD: mtekk_medium Max length of 32 characters NO: – s p a c e s – UPPERCASE – wp_ prefix

CPTS VS TAXONOMIES VS META VS OTHERS Dont Custom Post Type all the things

When to Use a CPT When for anything post or page like – Most things that would have required a custom table in the past – Products for a ecommerce site – Events for event calendars When you want WordPress to do most of the heavy lifting – Attachments, featured images, Dashboard UI, templates, etc.

When to Use a Taxonomy When you need to logically organize a collection of posts (of same or mixed type) – Mediums for projects in a portfolio

When to Use Postmeta When you need to add extra information to a post – Project completion date for a portfolio project When you need to sort by that information

DEMO

Questions? Find me on

Resources types-in-wordpress-3-0/ ster_post_type custom-taxonomy/ ster_taxonomy