hazlitt eastman at wp-brighton 2011 - wordpress custom post types
TRANSCRIPT
![Page 1: Hazlitt Eastman at WP-Brighton 2011 - WordPress Custom Post Types](https://reader037.vdocuments.net/reader037/viewer/2022100500/55525dddb4c9052e1f8b49ff/html5/thumbnails/1.jpg)
Diving into Wordpress Custom Post Types
Hazlitt Eastman
www.manta9.com@hazlitteastman
Wordpress theme and plugin development, Codeigniter, PHP / MySQL / Javascript / HTML / CSS
![Page 2: Hazlitt Eastman at WP-Brighton 2011 - WordPress Custom Post Types](https://reader037.vdocuments.net/reader037/viewer/2022100500/55525dddb4c9052e1f8b49ff/html5/thumbnails/2.jpg)
- What are Custom Post Types?
- Web site example
- Useful plugins
- Code
www.manta9.com@hazlitteastman
What are we going to look at?
![Page 3: Hazlitt Eastman at WP-Brighton 2011 - WordPress Custom Post Types](https://reader037.vdocuments.net/reader037/viewer/2022100500/55525dddb4c9052e1f8b49ff/html5/thumbnails/3.jpg)
What are Custom Post Types?Provide a method by which we can structure different types of website content. (not just Posts and Pages)
Examples:
- Adverts- DVDs- Books- Testimonials- Tour dates
www.manta9.com@hazlitteastman
![Page 4: Hazlitt Eastman at WP-Brighton 2011 - WordPress Custom Post Types](https://reader037.vdocuments.net/reader037/viewer/2022100500/55525dddb4c9052e1f8b49ff/html5/thumbnails/4.jpg)
Website Front End Example
www.offthekerb.co.uk
Contains 11 Custom Post Types
www.manta9.com@hazlitteastman
![Page 5: Hazlitt Eastman at WP-Brighton 2011 - WordPress Custom Post Types](https://reader037.vdocuments.net/reader037/viewer/2022100500/55525dddb4c9052e1f8b49ff/html5/thumbnails/5.jpg)
Useful Plugins- Can be created in functions.php using the
register_post_type() Wordpress function
- Custom Post Type UI
- Verve Metabox
- More Fields
- Advanced Custom Fieldswww.manta9.com@hazlitteastman
![Page 6: Hazlitt Eastman at WP-Brighton 2011 - WordPress Custom Post Types](https://reader037.vdocuments.net/reader037/viewer/2022100500/55525dddb4c9052e1f8b49ff/html5/thumbnails/6.jpg)
Website Back End Example
www.offthekerb.co.uk
- As an Editor
- As an Administrator
www.manta9.com@hazlitteastman
![Page 7: Hazlitt Eastman at WP-Brighton 2011 - WordPress Custom Post Types](https://reader037.vdocuments.net/reader037/viewer/2022100500/55525dddb4c9052e1f8b49ff/html5/thumbnails/7.jpg)
Code example using query_posts()query_posts( 'posts_per_page=-1&post_type=dvds');
if(have_posts()) :while(have_posts()) : the_post(); //loop opened
$image = get_post_meta($post->ID, 'image_2', true);$link = get_post_meta($post->ID, 'link_2', true);$title = get_the_title();
echo "<li>\n";echo "<a href=\"http://" . $link . "\" target=\"_blank\"><img src=\"" .
$image . "\" alt=\"" . $title. "\" /></a>\n";echo "</li>\n";
endwhile; //loop closedendif; //have_posts closed
www.manta9.com@hazlitteastman
![Page 8: Hazlitt Eastman at WP-Brighton 2011 - WordPress Custom Post Types](https://reader037.vdocuments.net/reader037/viewer/2022100500/55525dddb4c9052e1f8b49ff/html5/thumbnails/8.jpg)
- What are Custom Post Types?
- Web site example
- Useful plugins
- Code
www.manta9.com@hazlitteastman
What have we looked at?
![Page 9: Hazlitt Eastman at WP-Brighton 2011 - WordPress Custom Post Types](https://reader037.vdocuments.net/reader037/viewer/2022100500/55525dddb4c9052e1f8b49ff/html5/thumbnails/9.jpg)
Diving into Wordpress Custom Post Types
www.manta9.com@hazlitteastman
Questions...