WordPress 3 and You
-
date post
18-Oct-2014 -
Category
Technology
-
view
4.361 -
download
4
description
Transcript of WordPress 3 and You
1
WordPress 3 and You
Oren Yomtov
2
Google Reader
3
Stickers
4
Tattoos
5
WordPress Cars
6
Volkswagen = WordPress?
http://j.mp/aAhHMV
7
Fight the Fake Logo
http://j.mp/cFMrzT
8
View Source
9
10
Your Own Username & Password
11
New Look (Well.. Kind of)
12
Kubrick is DEAD
13
Twenty Ten
14
Commented Code
15
Custom Header
16
Admin Page
17
Four constants must be defined
define('HEADER_IMAGE', ‘%s/images/default_header.jpg');
define('HEADER_IMAGE_WIDTH', 775);
define('HEADER_IMAGE_HEIGHT', 200);
define('HEADER_TEXTCOLOR', 'ffffff');
18
If you don't want to allow changing the header text color, add:
define('NO_HEADER_TEXT', true );
Then change the first definition to:
define('HEADER_TEXTCOLOR', '');
19
Next you need to write two functions
add_custom_image_header( ‘header_style’, ‘admin_header_style’ )
http://j.mp/dcuRSv
20
Function 1
// gets included in the site headerfunction header_style() { ?><style type="text/css"> #header { background: url(<?php header_image(); ?>); } </style><?php}
21
Function 2
// gets included in the admin headerfunction admin_header_style() { ?><style type="text/css"> #headimg { width: <?php echo HEADER_IMAGE_WIDTH; ?>px; height: <?php echo HEADER_IMAGE_HEIGHT; ?>px; } </style><?php}
22
Default Headers
23
Default Headers
register_default_headers( array('berries' => array(
'url' => '%s/images/headers/berries.jpg','thumbnail_url' =>
'%s/images/headers/berries-thumbnail.jpg',/* translators: header image description */'description' => __( 'Berries', 'twentyten' )
)) );
24
Text Preview
25
Text Color
26
Custom Background
27
Admin Page
28
Custom Background Code
add_custom_background();
http://j.mp/ b9OJy0
29
Shortlinks
30
Shortlinks Code
the_shortlink( $text, $title, $before, $after );
wp_get_shortlink( 123 );
31
32
Menus
33
Menus
34
Menus
35
Menus
36
Menus
37
Menus Code
register_nav_menus( array('primary' => __( 'Primary Navigation',
'twentyten' ),) );
http://j.mp/abx5hV
38
Menus Code
wp_nav_menu(array(
'container_class' => 'menu-header','theme_location' => 'primary‘
));
http://j.mp/97n79t
39
Menus Code
http://j.mp/97n79t
40
Custom Post Types and Taxonomies
41
Default Types
• Post• Page
• Attachment• Revision• Menu
http://j.mp/d1nqEJ
42
The Ugly Wayregister_post_type('podcasts',
array('label' => 'Podcasts','public' => true,'show_ui' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => ‘podcasts'),'query_var' => true,'supports' => array('title','editor',)
));
43
Custom Post Type UI
44
Custom Columns
45
Custom Columns
46
Custom Columns
add_action("manage_posts_custom_column", "my_custom_columns");
add_filter("manage_edit-podcasts_columns", "my_podcasts_columns");
47
my_podcasts_columns
function my_podcasts_columns($columns){
$columns = array("cb" => "<input type=\"checkbox\" />","title" => "Podcast Title","description" => "Description","speakers" => "Speakers","comments" => 'Comments'
);return $columns;
}
48
my_custom_columns
function my_custom_columns($column){
global $post;
if ("description" == $column)echo $post->post_content;
elseif ("speakers" == $column)the_terms($post->ID, 'speakers');
}
49
Displaying Custom Post Types
query_posts(‘post_type=podcasts’);
http://j.mp/9S1a6z
50
Displaying Custom Taxonomies
the_terms($post->ID, 'speakers');
get_the_terms($post->ID, 'speakers');
http://j.mp/9S1a6zhttp://j.mp/9Dft6I
51
Multisite
Yup, back to the browser man.
Oh, and open an FTP client.
52
This is The Last Slide
• Thank you for listening!
• You should look me up on Linkedin, Facebook & Twitter (@orenyomtov)
• You may soon download this presentation from orenyomtov.com