Take control of your SAP testing with UiPath Test Suite
Wp meetup custom post types
1. Custom Post Types in WordPress 3.x Setup, Customization and Useage Scenarios Morten Rand-Hendriksen Creative Director, Pink & Yellow Media www.designisphilosophy.com Twitter: @mor10 HELLO,MY NAME IS MOR10people tend to spell it with an ‘o’, but that’s just plain wrong
2. WordPress Developers Unite! ! Not your regular WordCamp Speakers announced today Tickets: $85www.wordcampdevelopers.com
3. Like “regular” WordPress posts, but handled separately. Custom single template Custom index page Custom taxonomies (categories and tags) Custom taxonomy indexes Advanced custom queries WHAT ARE CUSTOM POST TYPES ?
6. // Add new post type for Shoots add_action('init', 'adley_shoots_init'); function adley_shoots_init() { $labels = array( … stuff … ); $args = array( … stuff … ); register_post_type('shoot',$args); } CREATING A NEW CUSTOM POST TYPE #
7. $labels = array( 'name' => _x('Shoots', 'general name'), 'singular_name' => _x('Shoot', 'singular name'), 'add_new' => _x('Add new shoot', 'shoot'), 'add_new_item' => __('Add new shoot'), 'edit_item' => __('Edit shoot'), 'new_item' => __('New shoot'), 'view_item' => __('View shoot'), 'search_items' => __('Search shoots'), 'not_found' => __('No shoots found'), 'not_found_in_trash' => __('No shoots found in trash'), 'parent_item_colon' => '' ); CREATING A NEW CUSTOM POST TYPE #
22. // Adds custom icon to the Shoots tab add_action( 'admin_head', 'cpt_icons' ); function cpt_icons() { ?> <style type="text/css" media="screen"> #menu-posts-shoot .wp-menu-image { background: url(<?phpbloginfo('template_url') ?>/images/photo-album.png) no-repeat 6px – 17px !important; } #menu-posts-shoot:hover .wp-menu-image, #menu-posts-shoot.wp-has-current-submenu .wp-menu-image { background-position:6px 7px!important; } </style> <?php } CUSTOM POST TYPE ICONS #
23. // Adds custom icon to the Shoots tab add_action( 'admin_head', 'cpt_icons' ); function cpt_icons() { ?> <style type="text/css" media="screen"> #menu-posts-shoot .wp-menu-image { background: url(<?phpbloginfo('template_url')?>/images/photo-album.png) no-repeat 6px – 17px !important; } #menu-posts-shoot:hover .wp-menu-image, #menu-posts-shoot.wp-has-current-submenu .wp-menu-image { background-position:6px 7px!important; } </style> <?php } CUSTOM POST TYPE ICONS #
24. // Adds custom icon to the Shoots tab add_action( 'admin_head', 'cpt_icons' ); function cpt_icons() { ?> <style type="text/css" media="screen"> #menu-posts-shoot .wp-menu-image { background: url(<?phpbloginfo('template_url')?>/images/photo-album.png) no-repeat 6px – 17px !important; } #menu-posts-shoot:hover .wp-menu-image, #menu-posts-shoot.wp-has-current-submenu .wp-menu-image { background-position:6px 7px!important; } </style> <?php } CUSTOM POST TYPE ICONS #
25. For single pages: single-postType.php For taxonomy pages: taxonomy.php For index page(s) (new in 3.1): archive-postType.php CUSTOM POST TYPE PAGES ?