Top Banner
WordPress 3 and You Oren Yomtov 1
52

WordPress 3 and You

Oct 18, 2014

Download

Technology

WordPress 3 has brought with it lots of changes and improvements to the already wonderful system we are already familiar with. This lecture will review all the changes and explain the best way to utilize them and when. This is important information for any developer who doesn’t want to be left in the dust as WordPress keeps going forwards.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: WordPress 3 and You

1

WordPress 3 and You

Oren Yomtov

Page 2: WordPress 3 and You

2

Google Reader

Page 3: WordPress 3 and You

3

Stickers

Page 4: WordPress 3 and You

4

Tattoos

Page 5: WordPress 3 and You

5

WordPress Cars

Page 6: WordPress 3 and You

6

Volkswagen = WordPress?

http://j.mp/aAhHMV

Page 7: WordPress 3 and You

7

Fight the Fake Logo

http://j.mp/cFMrzT

Page 8: WordPress 3 and You

8

View Source

Page 9: WordPress 3 and You

9

Page 10: WordPress 3 and You

10

Your Own Username & Password

Page 11: WordPress 3 and You

11

New Look (Well.. Kind of)

Page 12: WordPress 3 and You

12

Kubrick is DEAD

Page 13: WordPress 3 and You

13

Twenty Ten

Page 14: WordPress 3 and You

14

Commented Code

Page 15: WordPress 3 and You

15

Custom Header

Page 16: WordPress 3 and You

16

Admin Page

Page 17: WordPress 3 and You

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');

Page 18: WordPress 3 and You

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', '');

Page 19: WordPress 3 and You

19

Next you need to write two functions

add_custom_image_header( ‘header_style’, ‘admin_header_style’ )

http://j.mp/dcuRSv

Page 20: WordPress 3 and You

20

Function 1

// gets included in the site headerfunction header_style() { ?><style type="text/css"> #header { background: url(<?php header_image(); ?>); } </style><?php}

Page 21: WordPress 3 and You

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}

Page 22: WordPress 3 and You

22

Default Headers

Page 23: WordPress 3 and You

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' )

)) );

Page 24: WordPress 3 and You

24

Text Preview

Page 25: WordPress 3 and You

25

Text Color

Page 26: WordPress 3 and You

26

Custom Background

Page 27: WordPress 3 and You

27

Admin Page

Page 28: WordPress 3 and You

28

Custom Background Code

add_custom_background();

http://j.mp/ b9OJy0

Page 29: WordPress 3 and You

29

Shortlinks

Page 30: WordPress 3 and You

30

Shortlinks Code

the_shortlink( $text, $title, $before, $after );

wp_get_shortlink( 123 );

Page 31: WordPress 3 and You

31

Page 32: WordPress 3 and You

32

Menus

Page 33: WordPress 3 and You

33

Menus

Page 34: WordPress 3 and You

34

Menus

Page 35: WordPress 3 and You

35

Menus

Page 36: WordPress 3 and You

36

Menus

Page 37: WordPress 3 and You

37

Menus Code

register_nav_menus( array('primary' => __( 'Primary Navigation',

'twentyten' ),) );

http://j.mp/abx5hV

Page 38: WordPress 3 and You

38

Menus Code

wp_nav_menu(array(

'container_class' => 'menu-header','theme_location' => 'primary‘

));

http://j.mp/97n79t

Page 39: WordPress 3 and You

39

Menus Code

http://j.mp/97n79t

Page 40: WordPress 3 and You

40

Custom Post Types and Taxonomies

Page 41: WordPress 3 and You

41

Default Types

• Post• Page

• Attachment• Revision• Menu

http://j.mp/d1nqEJ

Page 42: WordPress 3 and You

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',)

));

Page 43: WordPress 3 and You

43

Custom Post Type UI

Page 44: WordPress 3 and You

44

Custom Columns

Page 45: WordPress 3 and You

45

Custom Columns

Page 46: WordPress 3 and You

46

Custom Columns

add_action("manage_posts_custom_column", "my_custom_columns");

add_filter("manage_edit-podcasts_columns", "my_podcasts_columns");

Page 47: WordPress 3 and You

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;

}

Page 48: WordPress 3 and You

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');

}

Page 49: WordPress 3 and You

49

Displaying Custom Post Types

query_posts(‘post_type=podcasts’);

http://j.mp/9S1a6z

Page 50: WordPress 3 and You

50

Displaying Custom Taxonomies

the_terms($post->ID, 'speakers');

get_the_terms($post->ID, 'speakers');

http://j.mp/9S1a6zhttp://j.mp/9Dft6I

Page 51: WordPress 3 and You

51

Multisite

Yup, back to the browser man.

Oh, and open an FTP client.

Page 52: WordPress 3 and You

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