├── README.md ├── chapter_04 ├── v1 │ └── wicked │ │ ├── functions.php │ │ ├── readme.txt │ │ └── style.css ├── v2 │ └── wicked │ │ ├── functions.php │ │ ├── readme.txt │ │ └── style.css ├── v3 │ └── wicked │ │ ├── functions.php │ │ ├── newstyles.css │ │ ├── readme.txt │ │ └── style.css └── v4 │ └── wicked │ ├── functions.php │ ├── gradient.png │ ├── redshoes.jpg │ ├── style.css │ ├── theshoes.jpg │ └── wallofshoes.jpg ├── chapter_05 ├── v1 │ └── wicked │ │ ├── functions.php │ │ ├── home.php │ │ ├── newstyles.css │ │ ├── readme.txt │ │ └── style.css ├── v2 │ └── wicked │ │ ├── footer-homepage.php │ │ ├── functions.php │ │ ├── home.php │ │ ├── newstyles.css │ │ ├── readme.txt │ │ └── style.css ├── v3 │ └── wicked │ │ ├── footer-homepage.php │ │ ├── functions.php │ │ ├── home.php │ │ ├── images │ │ └── favicon.ico │ │ ├── newstyles.css │ │ ├── readme.txt │ │ └── style.css ├── v4 │ └── wicked │ │ ├── footer-homepage.php │ │ ├── functions.php │ │ ├── home.php │ │ ├── images │ │ └── favicon.ico │ │ ├── newstyles.css │ │ ├── readme.txt │ │ └── style.css ├── v5 │ └── wicked │ │ ├── footer-homepage.php │ │ ├── functions.php │ │ ├── home.php │ │ ├── images │ │ └── favicon.ico │ │ ├── newstyles.css │ │ ├── readme.txt │ │ └── style.css └── v6 │ └── wicked │ ├── footer-homepage.php │ ├── functions.php │ ├── home.php │ ├── images │ └── favicon.ico │ ├── newstyles.css │ ├── readme.txt │ └── style.css ├── chapter_06 ├── v1 │ └── wicked │ │ ├── footer-homepage.php │ │ ├── functions.php │ │ ├── home.php │ │ ├── images │ │ └── favicon.ico │ │ ├── newstyles.css │ │ ├── readme.txt │ │ └── style.css ├── v2 │ └── wicked │ │ ├── footer-homepage.php │ │ ├── functions.php │ │ ├── home.php │ │ ├── images │ │ └── favicon.ico │ │ ├── library │ │ └── widget-areas.php │ │ ├── newstyles.css │ │ ├── readme.txt │ │ └── style.css ├── v3 │ └── wicked │ │ ├── footer-homepage.php │ │ ├── functions.php │ │ ├── home.php │ │ ├── images │ │ └── favicon.ico │ │ ├── library │ │ └── widget-areas.php │ │ ├── newstyles.css │ │ ├── readme.txt │ │ └── style.css └── v4 │ └── wicked │ ├── footer-homepage.php │ ├── functions.php │ ├── home.php │ ├── images │ └── favicon.ico │ ├── library │ └── widget-areas.php │ ├── newstyles.css │ ├── readme.txt │ ├── style.css │ └── widgets │ └── author-data.php └── chapter_07 ├── v1 └── wicked │ ├── footer-homepage.php │ ├── functions.php │ ├── home.php │ ├── images │ ├── favicon.ico │ └── header.png │ ├── library │ ├── options.php │ ├── style-options.php │ └── widget-areas.php │ ├── newstyles.css │ ├── readme.txt │ ├── style.css │ └── widgets │ └── author-data.php ├── v2 └── wicked │ ├── footer-homepage.php │ ├── functions.php │ ├── home.php │ ├── images │ ├── favicon.ico │ └── header.png │ ├── library │ ├── options.php │ ├── style-options.php │ └── widget-areas.php │ ├── newstyles.css │ ├── readme.txt │ ├── style.css │ └── widgets │ └── author-data.php ├── v3 └── wicked │ ├── footer-homepage.php │ ├── functions.php │ ├── home.php │ ├── images │ ├── favicon.ico │ └── header.png │ ├── library │ ├── options.php │ ├── style-options.php │ └── widget-areas.php │ ├── newstyles.css │ ├── readme.txt │ ├── skins │ ├── blue │ │ ├── header.png │ │ ├── sk8r_header.png │ │ └── skin.css │ ├── red │ │ ├── header.png │ │ └── skin.css │ └── yellow │ │ ├── header.png │ │ └── skin.css │ ├── style.css │ └── widgets │ └── author-data.php ├── v4 └── wicked │ ├── footer-homepage.php │ ├── functions.php │ ├── home.php │ ├── images │ ├── favicon.ico │ └── header.png │ ├── library │ ├── options.php │ ├── style-options.php │ └── widget-areas.php │ ├── mission-statement.php │ ├── newstyles.css │ ├── readme.txt │ ├── skins │ ├── blue │ │ ├── header.png │ │ ├── sk8r_header.png │ │ └── skin.css │ ├── red │ │ ├── header.png │ │ └── skin.css │ └── yellow │ │ ├── header.png │ │ └── skin.css │ ├── style.css │ └── widgets │ └── author-data.php ├── v5 └── wicked │ ├── footer-homepage.php │ ├── functions.php │ ├── home.php │ ├── images │ ├── favicon.ico │ └── header.png │ ├── library │ ├── options.php │ ├── style-options.php │ └── widget-areas.php │ ├── mission-statement.php │ ├── newstyles.css │ ├── readme.txt │ ├── skins │ ├── blue │ │ ├── header.png │ │ ├── sk8r_header.png │ │ └── skin.css │ ├── red │ │ ├── header.png │ │ └── skin.css │ └── yellow │ │ ├── header.png │ │ └── skin.css │ ├── style.css │ └── widgets │ └── author-data.php └── v6 └── wicked ├── footer-homepage.php ├── functions.php ├── home.php ├── images ├── favicon.ico └── header.png ├── library ├── options.php ├── style-options.php └── widget-areas.php ├── mission-statement.php ├── newstyles.css ├── readme.txt ├── skins ├── blue │ ├── header.png │ ├── sk8r_header.png │ └── skin.css ├── red │ ├── header.png │ └── skin.css └── yellow │ ├── header.png │ └── skin.css ├── style.css └── widgets └── author-data.php /README.md: -------------------------------------------------------------------------------- 1 | # Build Your Own Wicked WordPress Themes 2 | 3 | View this great course at [Learnable](https://learnable.com/books/wordpress1) 4 | -------------------------------------------------------------------------------- /chapter_04/v1/wicked/functions.php: -------------------------------------------------------------------------------- 1 | 'Home', 16 | // 'sort_column' => 'menu_order', 17 | // 'menu_class' => 'menu', 18 | // 'echo' => true 19 | // ); 20 | // return $args; 21 | //} 22 | //add_filter('wp_page_menu_args','childtheme_menu_args'); 23 | 24 | 25 | ?> -------------------------------------------------------------------------------- /chapter_04/v1/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_04/v1/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: A Thematic Child Theme 3 | Theme URI: 4 | Description: Use this theme to start your Thematic Child Theme development. 5 | Author: Ian Stewart 6 | Author URI: http://themeshaper.com/ 7 | Template: thematic 8 | Version: 1.0 9 | Tags: Thematic 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-r-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors */ 28 | /* It's better to actually copy over default.css into this file (or link to a copy in your child theme) if you're going to do anything outrageous */ 29 | @import url('../thematic/library/styles/default.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_04/v2/wicked/functions.php: -------------------------------------------------------------------------------- 1 | 'Home', 16 | // 'sort_column' => 'menu_order', 17 | // 'menu_class' => 'menu', 18 | // 'echo' => true 19 | // ); 20 | // return $args; 21 | //} 22 | //add_filter('wp_page_menu_args','childtheme_menu_args'); 23 | 24 | 25 | ?> -------------------------------------------------------------------------------- /chapter_04/v2/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_04/v2/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | This theme is © Raena Jackson Armitage 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-r-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors */ 28 | /* It's better to actually copy over default.css into this file (or link to a copy in your child theme) if you're going to do anything outrageous */ 29 | @import url('../thematic/library/styles/default.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | -------------------------------------------------------------------------------- /chapter_04/v3/wicked/functions.php: -------------------------------------------------------------------------------- 1 | 'Home', 16 | // 'sort_column' => 'menu_order', 17 | // 'menu_class' => 'menu', 18 | // 'echo' => true 19 | // ); 20 | // return $args; 21 | //} 22 | //add_filter('wp_page_menu_args','childtheme_menu_args'); 23 | 24 | 25 | ?> -------------------------------------------------------------------------------- /chapter_04/v3/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_04/v3/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_04/v4/wicked/functions.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_04/v4/wicked/gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_04/v4/wicked/gradient.png -------------------------------------------------------------------------------- /chapter_04/v4/wicked/redshoes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_04/v4/wicked/redshoes.jpg -------------------------------------------------------------------------------- /chapter_04/v4/wicked/theshoes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_04/v4/wicked/theshoes.jpg -------------------------------------------------------------------------------- /chapter_04/v4/wicked/wallofshoes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_04/v4/wicked/wallofshoes.jpg -------------------------------------------------------------------------------- /chapter_05/v1/wicked/functions.php: -------------------------------------------------------------------------------- 1 | 'Home', 16 | // 'sort_column' => 'menu_order', 17 | // 'menu_class' => 'menu', 18 | // 'echo' => true 19 | // ); 20 | // return $args; 21 | //} 22 | //add_filter('wp_page_menu_args','childtheme_menu_args'); 23 | 24 | 25 | ?> -------------------------------------------------------------------------------- /chapter_05/v1/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 | -------------------------------------------------------------------------------- /chapter_05/v1/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_05/v1/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_05/v2/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_05/v2/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 5 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 6 | echo ''; 7 | } 8 | 9 | ?> -------------------------------------------------------------------------------- /chapter_05/v2/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 | -------------------------------------------------------------------------------- /chapter_05/v2/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_05/v2/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_05/v3/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_05/v3/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 5 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 6 | echo ''; 7 | } 8 | 9 | // Add a favicon 10 | function wicked_favicon() { 11 | echo ''; 12 | } 13 | add_action('wp_head', 'wicked_favicon'); 14 | 15 | ?> -------------------------------------------------------------------------------- /chapter_05/v3/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 | -------------------------------------------------------------------------------- /chapter_05/v3/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_05/v3/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_05/v3/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_05/v3/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_05/v4/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_05/v4/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 5 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 6 | echo ''; 7 | } 8 | 9 | // Add a favicon 10 | function wicked_favicon() { 11 | echo ''; 12 | } 13 | add_action('wp_head', 'wicked_favicon'); 14 | 15 | // Add social media links 16 | function wicked_linklove($content) { 17 | if(is_single()) { 18 | $content .= '
19 | Did you love this post? Tell everyone you know, right now! 20 | ⋮ Paste the markup you received from AddThis here. 21 |
'; 22 | } 23 | return $content; 24 | } 25 | add_filter('thematic_post','wicked_linklove', 90); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_05/v4/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 | -------------------------------------------------------------------------------- /chapter_05/v4/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_05/v4/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_05/v4/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_05/v4/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_05/v5/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_05/v5/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 5 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 6 | echo ''; 7 | } 8 | 9 | // Add a favicon 10 | function wicked_favicon() { 11 | echo ''; 12 | } 13 | add_action('wp_head', 'wicked_favicon'); 14 | 15 | // Add social media links 16 | function wicked_linklove($content) { 17 | if(is_single()) { 18 | $content .= '
19 | Did you love this post? Tell everyone you know, right now! 20 | ⋮ Paste the markup you received from AddThis here. 21 |
'; 22 | } 23 | return $content; 24 | } 25 | add_filter('thematic_post','wicked_linklove', 90); 26 | 27 | // Add an author bio to the end of single post pages 28 | function wicked_showbio($content) { 29 | if (is_single()) { 30 | $content .= '
'; 31 | $content .= '

About ' . get_the_author() . '

'; 32 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 33 | $content .= get_the_author_description() .'

'; 34 | } 35 | return $content; 36 | } 37 | add_filter('thematic_post','wicked_showbio', '70'); 38 | 39 | ?> -------------------------------------------------------------------------------- /chapter_05/v5/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 | -------------------------------------------------------------------------------- /chapter_05/v5/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_05/v5/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_05/v5/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_05/v5/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_05/v6/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_05/v6/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | query_posts("posts_per_page=4"); 48 | $counter = 1; 49 | if (have_posts()) : while (have_posts()) : the_post(); ?> 50 |
51 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | 62 |

Eek

63 |

There are no posts to show!

64 | -------------------------------------------------------------------------------- /chapter_05/v6/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_05/v6/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_05/v6/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_05/v6/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_05/v6/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_06/v1/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_06/v1/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | query_posts("posts_per_page=4"); 48 | $counter = 1; 49 | if (have_posts()) : while (have_posts()) : the_post(); ?> 50 |
51 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | 62 |

Eek

63 |

There are no posts to show!

64 | '; 71 | return $content; 72 | } 73 | function wicked_after_title($content) { 74 | $content = ''; return $content; 75 | } 76 | add_filter('thematic_before_title', 'wicked_before_title'); 77 | add_filter('thematic_after_title', 'wicked_after_title'); 78 | 79 | ?> -------------------------------------------------------------------------------- /chapter_06/v1/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_06/v1/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_06/v1/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_06/v1/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_06/v1/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_06/v2/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_06/v2/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | query_posts("posts_per_page=4"); 48 | $counter = 1; 49 | if (have_posts()) : while (have_posts()) : the_post(); ?> 50 |
51 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | 62 |

Eek

63 |

There are no posts to show!

64 | '; 71 | return $content; 72 | } 73 | function wicked_after_title($content) { 74 | $content = ''; return $content; 75 | } 76 | add_filter('thematic_before_title', 'wicked_before_title'); 77 | add_filter('thematic_after_title', 'wicked_after_title'); 78 | 79 | // include custom widget areas 80 | include('library/widget-areas.php'); 81 | 82 | ?> -------------------------------------------------------------------------------- /chapter_06/v2/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_06/v2/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_06/v2/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_06/v2/wicked/library/widget-areas.php: -------------------------------------------------------------------------------- 1 | 'Main Footer Aside', 7 | 'id' => 'footer-aside', 8 | 'description' => __('A widget area in the footer, above the subsidiary asides.', 'thematic'), 9 | 'before_widget' => thematic_before_widget(), 10 | 'after_widget' => thematic_after_widget(), 11 | 'before_title' => thematic_before_title(), 12 | 'after_title' => thematic_after_title(), ) 13 | ); 14 | } 15 | add_action('init', 'wicked_footer_aside'); 16 | 17 | // Add footer Sidebar Area 18 | function add_wicked_footer_aside() { 19 | if (is_sidebar_active('footer-aside')) { 20 | echo thematic_before_widget_area('footer-aside'); 21 | dynamic_sidebar('footer-aside'); 22 | echo thematic_after_widget_area('footer-aside'); 23 | } 24 | } 25 | add_action('thematic_footer','add_wicked_footer_aside', 10); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_06/v2/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_06/v2/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_06/v3/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_06/v3/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | query_posts("posts_per_page=4"); 48 | $counter = 1; 49 | if (have_posts()) : while (have_posts()) : the_post(); ?> 50 |
51 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | 62 |

Eek

63 |

There are no posts to show!

64 | '; 71 | return $content; 72 | } 73 | function wicked_after_title($content) { 74 | $content = ''; return $content; 75 | } 76 | add_filter('thematic_before_title', 'wicked_before_title'); 77 | add_filter('thematic_after_title', 'wicked_after_title'); 78 | 79 | // remove index insert aside 80 | function wicked_remove_index_insert() { 81 | unregister_sidebar('index-insert'); 82 | } 83 | add_action('init', 'wicked_remove_index_insert', 20); 84 | 85 | // include custom widget areas 86 | include('library/widget-areas.php'); 87 | 88 | 89 | 90 | ?> -------------------------------------------------------------------------------- /chapter_06/v3/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_06/v3/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_06/v3/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_06/v3/wicked/library/widget-areas.php: -------------------------------------------------------------------------------- 1 | 'Main Footer Aside', 7 | 'id' => 'footer-aside', 8 | 'description' => __('A widget area in the footer, above the subsidiary asides.', 'thematic'), 9 | 'before_widget' => thematic_before_widget(), 10 | 'after_widget' => thematic_after_widget(), 11 | 'before_title' => thematic_before_title(), 12 | 'after_title' => thematic_after_title(), ) 13 | ); 14 | } 15 | add_action('init', 'wicked_footer_aside'); 16 | 17 | // Add footer Sidebar Area 18 | function add_wicked_footer_aside() { 19 | if (is_sidebar_active('footer-aside')) { 20 | echo thematic_before_widget_area('footer-aside'); 21 | dynamic_sidebar('footer-aside'); 22 | echo thematic_after_widget_area('footer-aside'); 23 | } 24 | } 25 | add_action('thematic_footer','add_wicked_footer_aside', 10); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_06/v3/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_06/v3/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_06/v4/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_06/v4/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | query_posts("posts_per_page=4"); 48 | $counter = 1; 49 | if (have_posts()) : while (have_posts()) : the_post(); ?> 50 |
51 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | 62 |

Eek

63 |

There are no posts to show!

64 | '; 71 | return $content; 72 | } 73 | function wicked_after_title($content) { 74 | $content = ''; return $content; 75 | } 76 | add_filter('thematic_before_title', 'wicked_before_title'); 77 | add_filter('thematic_after_title', 'wicked_after_title'); 78 | 79 | // remove index insert aside 80 | function wicked_remove_index_insert() { 81 | unregister_sidebar('index-insert'); 82 | } 83 | add_action('init', 'wicked_remove_index_insert', 20); 84 | 85 | // include custom widget areas 86 | include('library/widget-areas.php'); 87 | 88 | 89 | 90 | ?> -------------------------------------------------------------------------------- /chapter_06/v4/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_06/v4/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_06/v4/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_06/v4/wicked/library/widget-areas.php: -------------------------------------------------------------------------------- 1 | 'Main Footer Aside', 7 | 'id' => 'footer-aside', 8 | 'description' => __('A widget area in the footer, above the subsidiary asides.', 'thematic'), 9 | 'before_widget' => thematic_before_widget(), 10 | 'after_widget' => thematic_after_widget(), 11 | 'before_title' => thematic_before_title(), 12 | 'after_title' => thematic_after_title(), ) 13 | ); 14 | } 15 | add_action('init', 'wicked_footer_aside'); 16 | 17 | // Add footer Sidebar Area 18 | function add_wicked_footer_aside() { 19 | if (is_sidebar_active('footer-aside')) { 20 | echo thematic_before_widget_area('footer-aside'); 21 | dynamic_sidebar('footer-aside'); 22 | echo thematic_after_widget_area('footer-aside'); 23 | } 24 | } 25 | add_action('thematic_footer','add_wicked_footer_aside', 10); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_06/v4/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_06/v4/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_06/v4/wicked/widgets/author-data.php: -------------------------------------------------------------------------------- 1 | 'A widget that displays author info on single posts.' 7 | ); 8 | $this->WP_Widget('author_data', 'Author Data', $widget_ops); 9 | } 10 | 11 | function form($instance) { 12 | $title = esc_attr($instance['title']); 13 | 14 | ?> 15 |

16 | 23 |

24 | '; 44 | echo get_avatar(get_the_author_meta('user_email'), 150); 45 | echo '

' . the_author_meta('display_name') . '

'; 46 | 47 | // Is there an author description? 48 | if (get_the_author_meta('description')) { 49 | echo '

' . get_the_author_meta('description') . '

'; 50 | } 51 | echo ''; 52 | echo $after_widget; 53 | } 54 | } 55 | } 56 | 57 | register_widget('Author_Data_Widget'); 58 | 59 | ?> -------------------------------------------------------------------------------- /chapter_07/v1/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_07/v1/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | query_posts("posts_per_page=4"); 48 | $counter = 1; 49 | if (have_posts()) : while (have_posts()) : the_post(); ?> 50 |
51 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | 62 |

Eek

63 |

There are no posts to show!

64 | '; 71 | return $content; 72 | } 73 | function wicked_after_title($content) { 74 | $content = ''; return $content; 75 | } 76 | add_filter('thematic_before_title', 'wicked_before_title'); 77 | add_filter('thematic_after_title', 'wicked_after_title'); 78 | 79 | // remove index insert aside 80 | function wicked_remove_index_insert() { 81 | unregister_sidebar('index-insert'); 82 | } 83 | add_action('init', 'wicked_remove_index_insert', 20); 84 | 85 | // include custom widget areas 86 | include('library/widget-areas.php'); 87 | 88 | // include theme options 89 | include('library/options.php'); 90 | // include style options stylesheets 91 | include('library/style-options.php'); 92 | 93 | 94 | 95 | ?> -------------------------------------------------------------------------------- /chapter_07/v1/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_07/v1/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v1/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_07/v1/wicked/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v1/wicked/images/header.png -------------------------------------------------------------------------------- /chapter_07/v1/wicked/library/options.php: -------------------------------------------------------------------------------- 1 | cat_ID] = $cat->cat_name; 16 | } 17 | 18 | $childoptions = array ( 19 | 20 | array( "name" => __('Link Color','thematic'), 21 | "desc" => __('Change the color of links by entering a HEX color number. (e.g.: 003333)','thematic'), 22 | "id" => "wicked_link_color", 23 | "std" => "999999", 24 | "type" => "text" 25 | ), 26 | array( "name" => __('Show Header Image','thematic'), 27 | "desc" => __('Show an image in the header. Replace the header.png file found in the /wicked/images/ folder with your own image, up to 120x100px.','thematic'), 28 | "id" => "wicked_show_logo", 29 | "std" => "false", 30 | "type" => "checkbox" 31 | ), 32 | array( "name" => __('Featured Category','thematic'), 33 | "desc" => __('A category of posts to be featured on the front page.','thematic'), 34 | "id" => "wicked_feature_cat", 35 | "std" => $default_cat, 36 | "type" => "select", 37 | "options" => $categories 38 | ) 39 | ); 40 | } 41 | add_action('init', 'childtheme_options'); 42 | 43 | // Make a Theme Options Page 44 | function childtheme_add_admin() { 45 | global $childthemename, $childshortname, $childoptions; 46 | 47 | if ( $_GET['page'] == basename(__FILE__) ) { 48 | 49 | if ( 'save' == $_REQUEST['action'] ) { 50 | // protect against request forgery 51 | check_admin_referer('childtheme-save'); 52 | // save the options 53 | foreach ($childoptions as $value) { 54 | if( isset( $_REQUEST[ $value['id'] ] ) ) { 55 | update_option( $value['id'], $_REQUEST[ $value['id'] ] ); 56 | } else { 57 | delete_option( $value['id'] ); 58 | } 59 | } 60 | 61 | // return to the options page 62 | header("Location: themes.php?page=options.php&saved=true"); 63 | die; 64 | 65 | } else if ( 'reset' == $_REQUEST['action'] ) { 66 | // protect against request forgery 67 | check_admin_referer('childtheme-reset'); 68 | // delete the options 69 | foreach ($childoptions as $value) { 70 | delete_option( $value['id'] ); 71 | } 72 | 73 | // return to the options page 74 | header("Location: themes.php?page=options.php&reset=true"); 75 | die; 76 | } 77 | } 78 | add_theme_page($childthemename." Options", "$childthemename Options", 'edit_themes', basename(__FILE__), 'childtheme_admin'); 79 | } 80 | add_action('admin_menu' , 'childtheme_add_admin'); 81 | 82 | function childtheme_admin() { 83 | 84 | global $childthemename, $childshortname, $childoptions; 85 | 86 | // Saved or Updated message 87 | if ( $_REQUEST['saved'] ) echo '

'.$childthemename.' settings saved.

'; 88 | if ( $_REQUEST['reset'] ) echo '

'.$childthemename.' settings reset.

'; 89 | 90 | // The form 91 | ?> 92 | 93 |
94 |

Options

95 | 96 |
97 | 98 | 99 | 100 | 101 | 108 | 109 | 110 | 114 | 115 | 120 | 121 | 122 | 137 | 138 | 144 | 145 | 146 | 152 | 153 | 158 | 159 | 160 | 172 | 173 | 178 | 179 | 180 | 191 | 192 | 200 | 201 |
: 111 | 112 | 113 |
123 | 135 | 136 |
: 147 | 148 | 151 |
: 161 | $option) { 162 | if ($key == get_option($value['id'], $value['std']) ) { 163 | $checked = "checked=\"checked\""; 164 | } else { 165 | $checked = ""; 166 | } 167 | ?> 168 | />
169 | 170 | 171 |
181 | 188 | /> 189 | 190 |
202 | 203 |

204 | 205 | 206 |

207 | 208 |
209 | 210 |
211 | 212 |

213 | 214 | 215 |

216 |
217 | 218 |

Build Your Own Wicked WordPress Themes. If you have any questions, visit the SitePoint Forums.', 'thematic'); ?>

219 | 220 | -------------------------------------------------------------------------------- /chapter_07/v1/wicked/library/style-options.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 33 | 34 | -------------------------------------------------------------------------------- /chapter_07/v1/wicked/library/widget-areas.php: -------------------------------------------------------------------------------- 1 | 'Main Footer Aside', 7 | 'id' => 'footer-aside', 8 | 'description' => __('A widget area in the footer, above the subsidiary asides.', 'thematic'), 9 | 'before_widget' => thematic_before_widget(), 10 | 'after_widget' => thematic_after_widget(), 11 | 'before_title' => thematic_before_title(), 12 | 'after_title' => thematic_after_title(), ) 13 | ); 14 | } 15 | add_action('init', 'wicked_footer_aside'); 16 | 17 | // Add footer Sidebar Area 18 | function add_wicked_footer_aside() { 19 | if (is_sidebar_active('footer-aside')) { 20 | echo thematic_before_widget_area('footer-aside'); 21 | dynamic_sidebar('footer-aside'); 22 | echo thematic_after_widget_area('footer-aside'); 23 | } 24 | } 25 | add_action('thematic_footer','add_wicked_footer_aside', 10); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_07/v1/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_07/v1/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_07/v1/wicked/widgets/author-data.php: -------------------------------------------------------------------------------- 1 | 'A widget that displays author info on single posts.' 7 | ); 8 | $this->WP_Widget('author_data', 'Author Data', $widget_ops); 9 | } 10 | 11 | function form($instance) { 12 | $title = esc_attr($instance['title']); 13 | 14 | ?> 15 |

16 | 23 |

24 | '; 44 | echo get_avatar(get_the_author_meta('user_email'), 150); 45 | echo '

' . the_author_meta('display_name') . '

'; 46 | 47 | // Is there an author description? 48 | if (get_the_author_meta('description')) { 49 | echo '

' . get_the_author_meta('description') . '

'; 50 | } 51 | echo '
'; 52 | echo $after_widget; 53 | } 54 | } 55 | } 56 | 57 | register_widget('Author_Data_Widget'); 58 | 59 | ?> -------------------------------------------------------------------------------- /chapter_07/v2/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_07/v2/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | 48 | // load the custom options 49 | global $childoptions; 50 | foreach ($childoptions as $value) { 51 | $$value['id'] = get_option($value['id'], $value['std']); 52 | } 53 | 54 | query_posts("posts_per_page=4&cat=" . $wicked_feature_cat); 55 | $counter = 1; 56 | if (have_posts()) : while (have_posts()) : the_post(); ?> 57 |
58 | 62 |
63 | 64 | 65 | 66 |
67 |
68 | 69 |

Eek

70 |

There are no posts to show!

71 | '; 78 | return $content; 79 | } 80 | function wicked_after_title($content) { 81 | $content = ''; return $content; 82 | } 83 | add_filter('thematic_before_title', 'wicked_before_title'); 84 | add_filter('thematic_after_title', 'wicked_after_title'); 85 | 86 | // remove index insert aside 87 | function wicked_remove_index_insert() { 88 | unregister_sidebar('index-insert'); 89 | } 90 | add_action('init', 'wicked_remove_index_insert', 20); 91 | 92 | function remove_thematic_blogtitle() { 93 | remove_action('thematic_header','thematic_blogtitle',3); 94 | } 95 | add_action('init','remove_thematic_blogtitle'); 96 | 97 | // blogtitle div with header image class 98 | function wicked_blogtitle() { 99 | // load the custom options 100 | global $childoptions; 101 | foreach ($childoptions as $value) { 102 | $$value['id'] = get_option($value['id'], $value['std']); 103 | } 104 | 105 | if('true' == $wicked_show_logo) { ?> 106 |
107 | 110 |
111 | -------------------------------------------------------------------------------- /chapter_07/v2/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_07/v2/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v2/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_07/v2/wicked/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v2/wicked/images/header.png -------------------------------------------------------------------------------- /chapter_07/v2/wicked/library/options.php: -------------------------------------------------------------------------------- 1 | cat_ID] = $cat->cat_name; 16 | } 17 | 18 | $childoptions = array ( 19 | 20 | array( "name" => __('Link Color','thematic'), 21 | "desc" => __('Change the color of links by entering a HEX color number. (e.g.: 003333)','thematic'), 22 | "id" => "wicked_link_color", 23 | "std" => "999999", 24 | "type" => "text" 25 | ), 26 | array( "name" => __('Show Header Image','thematic'), 27 | "desc" => __('Show an image in the header. Replace the header.png file found in the /wicked/images/ folder with your own image, up to 120x100px.','thematic'), 28 | "id" => "wicked_show_logo", 29 | "std" => "false", 30 | "type" => "checkbox" 31 | ), 32 | array( "name" => __('Featured Category','thematic'), 33 | "desc" => __('A category of posts to be featured on the front page.','thematic'), 34 | "id" => "wicked_feature_cat", 35 | "std" => $default_cat, 36 | "type" => "select", 37 | "options" => $categories 38 | ) 39 | ); 40 | } 41 | add_action('init', 'childtheme_options'); 42 | 43 | // Make a Theme Options Page 44 | function childtheme_add_admin() { 45 | global $childthemename, $childshortname, $childoptions; 46 | 47 | if ( $_GET['page'] == basename(__FILE__) ) { 48 | 49 | if ( 'save' == $_REQUEST['action'] ) { 50 | // protect against request forgery 51 | check_admin_referer('childtheme-save'); 52 | // save the options 53 | foreach ($childoptions as $value) { 54 | if( isset( $_REQUEST[ $value['id'] ] ) ) { 55 | update_option( $value['id'], $_REQUEST[ $value['id'] ] ); 56 | } else { 57 | delete_option( $value['id'] ); 58 | } 59 | } 60 | 61 | // return to the options page 62 | header("Location: themes.php?page=options.php&saved=true"); 63 | die; 64 | 65 | } else if ( 'reset' == $_REQUEST['action'] ) { 66 | // protect against request forgery 67 | check_admin_referer('childtheme-reset'); 68 | // delete the options 69 | foreach ($childoptions as $value) { 70 | delete_option( $value['id'] ); 71 | } 72 | 73 | // return to the options page 74 | header("Location: themes.php?page=options.php&reset=true"); 75 | die; 76 | } 77 | } 78 | add_theme_page($childthemename." Options", "$childthemename Options", 'edit_themes', basename(__FILE__), 'childtheme_admin'); 79 | } 80 | add_action('admin_menu' , 'childtheme_add_admin'); 81 | 82 | function childtheme_admin() { 83 | 84 | global $childthemename, $childshortname, $childoptions; 85 | 86 | // Saved or Updated message 87 | if ( $_REQUEST['saved'] ) echo '

'.$childthemename.' settings saved.

'; 88 | if ( $_REQUEST['reset'] ) echo '

'.$childthemename.' settings reset.

'; 89 | 90 | // The form 91 | ?> 92 | 93 |
94 |

Options

95 | 96 |
97 | 98 | 99 | 100 | 101 | 108 | 109 | 110 | 114 | 115 | 120 | 121 | 122 | 137 | 138 | 144 | 145 | 146 | 152 | 153 | 158 | 159 | 160 | 172 | 173 | 178 | 179 | 180 | 191 | 192 | 200 | 201 |
: 111 | 112 | 113 |
123 | 135 | 136 |
: 147 | 148 | 151 |
: 161 | $option) { 162 | if ($key == get_option($value['id'], $value['std']) ) { 163 | $checked = "checked=\"checked\""; 164 | } else { 165 | $checked = ""; 166 | } 167 | ?> 168 | />
169 | 170 | 171 |
181 | 188 | /> 189 | 190 |
202 | 203 |

204 | 205 | 206 |

207 | 208 |
209 | 210 |
211 | 212 |

213 | 214 | 215 |

216 |
217 | 218 |

Build Your Own Wicked WordPress Themes. If you have any questions, visit the SitePoint Forums.', 'thematic'); ?>

219 | 220 | -------------------------------------------------------------------------------- /chapter_07/v2/wicked/library/style-options.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 33 | 34 | -------------------------------------------------------------------------------- /chapter_07/v2/wicked/library/widget-areas.php: -------------------------------------------------------------------------------- 1 | 'Main Footer Aside', 7 | 'id' => 'footer-aside', 8 | 'description' => __('A widget area in the footer, above the subsidiary asides.', 'thematic'), 9 | 'before_widget' => thematic_before_widget(), 10 | 'after_widget' => thematic_after_widget(), 11 | 'before_title' => thematic_before_title(), 12 | 'after_title' => thematic_after_title(), ) 13 | ); 14 | } 15 | add_action('init', 'wicked_footer_aside'); 16 | 17 | // Add footer Sidebar Area 18 | function add_wicked_footer_aside() { 19 | if (is_sidebar_active('footer-aside')) { 20 | echo thematic_before_widget_area('footer-aside'); 21 | dynamic_sidebar('footer-aside'); 22 | echo thematic_after_widget_area('footer-aside'); 23 | } 24 | } 25 | add_action('thematic_footer','add_wicked_footer_aside', 10); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_07/v2/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_07/v2/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_07/v2/wicked/widgets/author-data.php: -------------------------------------------------------------------------------- 1 | 'A widget that displays author info on single posts.' 7 | ); 8 | $this->WP_Widget('author_data', 'Author Data', $widget_ops); 9 | } 10 | 11 | function form($instance) { 12 | $title = esc_attr($instance['title']); 13 | 14 | ?> 15 |

16 | 23 |

24 | '; 44 | echo get_avatar(get_the_author_meta('user_email'), 150); 45 | echo '

' . the_author_meta('display_name') . '

'; 46 | 47 | // Is there an author description? 48 | if (get_the_author_meta('description')) { 49 | echo '

' . get_the_author_meta('description') . '

'; 50 | } 51 | echo '
'; 52 | echo $after_widget; 53 | } 54 | } 55 | } 56 | 57 | register_widget('Author_Data_Widget'); 58 | 59 | ?> -------------------------------------------------------------------------------- /chapter_07/v3/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_07/v3/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | 48 | // load the custom options 49 | global $childoptions; 50 | foreach ($childoptions as $value) { 51 | $$value['id'] = get_option($value['id'], $value['std']); 52 | } 53 | 54 | query_posts("posts_per_page=4&cat=" . $wicked_feature_cat); 55 | $counter = 1; 56 | if (have_posts()) : while (have_posts()) : the_post(); ?> 57 |
58 | 62 |
63 | 64 | 65 | 66 |
67 |
68 | 69 |

Eek

70 |

There are no posts to show!

71 | '; 78 | return $content; 79 | } 80 | function wicked_after_title($content) { 81 | $content = ''; return $content; 82 | } 83 | add_filter('thematic_before_title', 'wicked_before_title'); 84 | add_filter('thematic_after_title', 'wicked_after_title'); 85 | 86 | // remove index insert aside 87 | function wicked_remove_index_insert() { 88 | unregister_sidebar('index-insert'); 89 | } 90 | add_action('init', 'wicked_remove_index_insert', 20); 91 | 92 | // include custom widget areas 93 | include('library/widget-areas.php'); 94 | 95 | // include theme options 96 | include('library/options.php'); 97 | // include style options stylesheets 98 | include('library/style-options.php'); 99 | 100 | ?> -------------------------------------------------------------------------------- /chapter_07/v3/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_07/v3/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v3/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_07/v3/wicked/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v3/wicked/images/header.png -------------------------------------------------------------------------------- /chapter_07/v3/wicked/library/options.php: -------------------------------------------------------------------------------- 1 | cat_ID] = $cat->cat_name; 16 | } 17 | 18 | // the color variants array 19 | $color_variants = array( 20 | "blue" => "blue", 21 | "red" => "red", 22 | "yellow" => "yellow" 23 | ); 24 | 25 | $childoptions = array ( 26 | 27 | array( "name" => __('Color Variant','thematic'), 28 | "desc" => __('Select which color scheme or variant you would like to use.','thematic'), 29 | "id" => "wicked_color_variant", 30 | "std" => 'blue', 31 | "type" => "radio", 32 | "options" => $color_variants 33 | ), 34 | array( "name" => __('Featured Category','thematic'), 35 | "desc" => __('A category of posts to be featured on the front page.','thematic'), 36 | "id" => "wicked_feature_cat", 37 | "std" => $default_cat, 38 | "type" => "select", 39 | "options" => $categories 40 | ) 41 | ); 42 | } 43 | add_action('init', 'childtheme_options'); 44 | 45 | // Make a Theme Options Page 46 | function childtheme_add_admin() { 47 | global $childthemename, $childshortname, $childoptions; 48 | 49 | if ( $_GET['page'] == basename(__FILE__) ) { 50 | 51 | if ( 'save' == $_REQUEST['action'] ) { 52 | // protect against request forgery 53 | check_admin_referer('childtheme-save'); 54 | // save the options 55 | foreach ($childoptions as $value) { 56 | if( isset( $_REQUEST[ $value['id'] ] ) ) { 57 | update_option( $value['id'], $_REQUEST[ $value['id'] ] ); 58 | } else { 59 | delete_option( $value['id'] ); 60 | } 61 | } 62 | 63 | // return to the options page 64 | header("Location: themes.php?page=options.php&saved=true"); 65 | die; 66 | 67 | } else if ( 'reset' == $_REQUEST['action'] ) { 68 | // protect against request forgery 69 | check_admin_referer('childtheme-reset'); 70 | // delete the options 71 | foreach ($childoptions as $value) { 72 | delete_option( $value['id'] ); 73 | } 74 | 75 | // return to the options page 76 | header("Location: themes.php?page=options.php&reset=true"); 77 | die; 78 | } 79 | } 80 | add_theme_page($childthemename." Options", "$childthemename Options", 'edit_themes', basename(__FILE__), 'childtheme_admin'); 81 | } 82 | add_action('admin_menu' , 'childtheme_add_admin'); 83 | 84 | function childtheme_admin() { 85 | 86 | global $childthemename, $childshortname, $childoptions; 87 | 88 | // Saved or Updated message 89 | if ( $_REQUEST['saved'] ) echo '

'.$childthemename.' settings saved.

'; 90 | if ( $_REQUEST['reset'] ) echo '

'.$childthemename.' settings reset.

'; 91 | 92 | // The form 93 | ?> 94 | 95 |
96 |

Options

97 | 98 |
99 | 100 | 101 | 102 | 103 | 110 | 111 | 112 | 116 | 117 | 122 | 123 | 124 | 139 | 140 | 146 | 147 | 148 | 154 | 155 | 160 | 161 | 162 | 174 | 175 | 180 | 181 | 182 | 193 | 194 | 202 | 203 |
: 113 | 114 | 115 |
125 | 137 | 138 |
: 149 | 150 | 153 |
: 163 | $option) { 164 | if ($key == get_option($value['id'], $value['std']) ) { 165 | $checked = "checked=\"checked\""; 166 | } else { 167 | $checked = ""; 168 | } 169 | ?> 170 | />
171 | 172 | 173 |
183 | 190 | /> 191 | 192 |
204 | 205 |

206 | 207 | 208 |

209 | 210 |
211 | 212 |
213 | 214 |

215 | 216 | 217 |

218 |
219 | 220 |

Build Your Own Wicked WordPress Themes. If you have any questions, visit the SitePoint Forums.', 'thematic'); ?>

221 | 222 | -------------------------------------------------------------------------------- /chapter_07/v3/wicked/library/style-options.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_07/v3/wicked/library/widget-areas.php: -------------------------------------------------------------------------------- 1 | 'Main Footer Aside', 7 | 'id' => 'footer-aside', 8 | 'description' => __('A widget area in the footer, above the subsidiary asides.', 'thematic'), 9 | 'before_widget' => thematic_before_widget(), 10 | 'after_widget' => thematic_after_widget(), 11 | 'before_title' => thematic_before_title(), 12 | 'after_title' => thematic_after_title(), ) 13 | ); 14 | } 15 | add_action('init', 'wicked_footer_aside'); 16 | 17 | // Add footer Sidebar Area 18 | function add_wicked_footer_aside() { 19 | if (is_sidebar_active('footer-aside')) { 20 | echo thematic_before_widget_area('footer-aside'); 21 | dynamic_sidebar('footer-aside'); 22 | echo thematic_after_widget_area('footer-aside'); 23 | } 24 | } 25 | add_action('thematic_footer','add_wicked_footer_aside', 10); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_07/v3/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_07/v3/wicked/skins/blue/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v3/wicked/skins/blue/header.png -------------------------------------------------------------------------------- /chapter_07/v3/wicked/skins/blue/sk8r_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v3/wicked/skins/blue/sk8r_header.png -------------------------------------------------------------------------------- /chapter_07/v3/wicked/skins/blue/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#0033FF;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v3/wicked/skins/red/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v3/wicked/skins/red/header.png -------------------------------------------------------------------------------- /chapter_07/v3/wicked/skins/red/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#FF0000;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v3/wicked/skins/yellow/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v3/wicked/skins/yellow/header.png -------------------------------------------------------------------------------- /chapter_07/v3/wicked/skins/yellow/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#FFFF00;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v3/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_07/v3/wicked/widgets/author-data.php: -------------------------------------------------------------------------------- 1 | 'A widget that displays author info on single posts.' 7 | ); 8 | $this->WP_Widget('author_data', 'Author Data', $widget_ops); 9 | } 10 | 11 | function form($instance) { 12 | $title = esc_attr($instance['title']); 13 | 14 | ?> 15 |

16 | 23 |

24 | '; 44 | echo get_avatar(get_the_author_meta('user_email'), 150); 45 | echo '

' . the_author_meta('display_name') . '

'; 46 | 47 | // Is there an author description? 48 | if (get_the_author_meta('description')) { 49 | echo '

' . get_the_author_meta('description') . '

'; 50 | } 51 | echo '
'; 52 | echo $after_widget; 53 | } 54 | } 55 | } 56 | 57 | register_widget('Author_Data_Widget'); 58 | 59 | ?> -------------------------------------------------------------------------------- /chapter_07/v4/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_07/v4/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | 48 | // load the custom options 49 | global $childoptions; 50 | foreach ($childoptions as $value) { 51 | $$value['id'] = get_option($value['id'], $value['std']); 52 | } 53 | 54 | query_posts("posts_per_page=4&cat=" . $wicked_feature_cat); 55 | $counter = 1; 56 | if (have_posts()) : while (have_posts()) : the_post(); ?> 57 |
58 | 62 |
63 | 64 | 65 | 66 |
67 |
68 | 69 |

Eek

70 |

There are no posts to show!

71 | '; 78 | return $content; 79 | } 80 | function wicked_after_title($content) { 81 | $content = ''; return $content; 82 | } 83 | add_filter('thematic_before_title', 'wicked_before_title'); 84 | add_filter('thematic_after_title', 'wicked_after_title'); 85 | 86 | // remove index insert aside 87 | function wicked_remove_index_insert() { 88 | unregister_sidebar('index-insert'); 89 | } 90 | add_action('init', 'wicked_remove_index_insert', 20); 91 | 92 | // include custom widget areas 93 | include('library/widget-areas.php'); 94 | 95 | // include theme options 96 | include('library/options.php'); 97 | // include style options stylesheets 98 | include('library/style-options.php'); 99 | 100 | ?> -------------------------------------------------------------------------------- /chapter_07/v4/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_07/v4/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v4/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_07/v4/wicked/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v4/wicked/images/header.png -------------------------------------------------------------------------------- /chapter_07/v4/wicked/library/options.php: -------------------------------------------------------------------------------- 1 | cat_ID] = $cat->cat_name; 16 | } 17 | 18 | // the color variants array 19 | $color_variants = array( 20 | "blue" => "blue", 21 | "red" => "red", 22 | "yellow" => "yellow" 23 | ); 24 | 25 | $childoptions = array ( 26 | 27 | array( "name" => __('Color Variant','thematic'), 28 | "desc" => __('Select which color scheme or variant you would like to use.','thematic'), 29 | "id" => "wicked_color_variant", 30 | "std" => 'blue', 31 | "type" => "radio", 32 | "options" => $color_variants 33 | ), 34 | array( "name" => __('Featured Category','thematic'), 35 | "desc" => __('A category of posts to be featured on the front page.','thematic'), 36 | "id" => "wicked_feature_cat", 37 | "std" => $default_cat, 38 | "type" => "select", 39 | "options" => $categories 40 | ) 41 | ); 42 | } 43 | add_action('init', 'childtheme_options'); 44 | 45 | // Make a Theme Options Page 46 | function childtheme_add_admin() { 47 | global $childthemename, $childshortname, $childoptions; 48 | 49 | if ( $_GET['page'] == basename(__FILE__) ) { 50 | 51 | if ( 'save' == $_REQUEST['action'] ) { 52 | // protect against request forgery 53 | check_admin_referer('childtheme-save'); 54 | // save the options 55 | foreach ($childoptions as $value) { 56 | if( isset( $_REQUEST[ $value['id'] ] ) ) { 57 | update_option( $value['id'], $_REQUEST[ $value['id'] ] ); 58 | } else { 59 | delete_option( $value['id'] ); 60 | } 61 | } 62 | 63 | // return to the options page 64 | header("Location: themes.php?page=options.php&saved=true"); 65 | die; 66 | 67 | } else if ( 'reset' == $_REQUEST['action'] ) { 68 | // protect against request forgery 69 | check_admin_referer('childtheme-reset'); 70 | // delete the options 71 | foreach ($childoptions as $value) { 72 | delete_option( $value['id'] ); 73 | } 74 | 75 | // return to the options page 76 | header("Location: themes.php?page=options.php&reset=true"); 77 | die; 78 | } 79 | } 80 | add_theme_page($childthemename." Options", "$childthemename Options", 'edit_themes', basename(__FILE__), 'childtheme_admin'); 81 | } 82 | add_action('admin_menu' , 'childtheme_add_admin'); 83 | 84 | function childtheme_admin() { 85 | 86 | global $childthemename, $childshortname, $childoptions; 87 | 88 | // Saved or Updated message 89 | if ( $_REQUEST['saved'] ) echo '

'.$childthemename.' settings saved.

'; 90 | if ( $_REQUEST['reset'] ) echo '

'.$childthemename.' settings reset.

'; 91 | 92 | // The form 93 | ?> 94 | 95 |
96 |

Options

97 | 98 |
99 | 100 | 101 | 102 | 103 | 110 | 111 | 112 | 116 | 117 | 122 | 123 | 124 | 139 | 140 | 146 | 147 | 148 | 154 | 155 | 160 | 161 | 162 | 174 | 175 | 180 | 181 | 182 | 193 | 194 | 202 | 203 |
: 113 | 114 | 115 |
125 | 137 | 138 |
: 149 | 150 | 153 |
: 163 | $option) { 164 | if ($key == get_option($value['id'], $value['std']) ) { 165 | $checked = "checked=\"checked\""; 166 | } else { 167 | $checked = ""; 168 | } 169 | ?> 170 | />
171 | 172 | 173 |
183 | 190 | /> 191 | 192 |
204 | 205 |

206 | 207 | 208 |

209 | 210 |
211 | 212 |
213 | 214 |

215 | 216 | 217 |

218 |
219 | 220 |

Build Your Own Wicked WordPress Themes. If you have any questions, visit the SitePoint Forums.', 'thematic'); ?>

221 | 222 | -------------------------------------------------------------------------------- /chapter_07/v4/wicked/library/style-options.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_07/v4/wicked/library/widget-areas.php: -------------------------------------------------------------------------------- 1 | 'Main Footer Aside', 7 | 'id' => 'footer-aside', 8 | 'description' => __('A widget area in the footer, above the subsidiary asides.', 'thematic'), 9 | 'before_widget' => thematic_before_widget(), 10 | 'after_widget' => thematic_after_widget(), 11 | 'before_title' => thematic_before_title(), 12 | 'after_title' => thematic_after_title(), ) 13 | ); 14 | } 15 | add_action('init', 'wicked_footer_aside'); 16 | 17 | // Add footer Sidebar Area 18 | function add_wicked_footer_aside() { 19 | if (is_sidebar_active('footer-aside')) { 20 | echo thematic_before_widget_area('footer-aside'); 21 | dynamic_sidebar('footer-aside'); 22 | echo thematic_after_widget_area('footer-aside'); 23 | } 24 | } 25 | add_action('thematic_footer','add_wicked_footer_aside', 10); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_07/v4/wicked/mission-statement.php: -------------------------------------------------------------------------------- 1 | 15 | 16 |
17 | 18 | 19 | 20 |
21 | 22 | 32 | 33 |
34 | 35 | 41 | 42 |
43 | 44 | ".__('Pages: ', 'thematic'), "
\n", 'number'); 49 | 50 | edit_post_link(__('Edit', 'thematic'),'','') ?> 51 | 52 |
53 |
54 | 55 | 66 | 67 |
68 | 69 | 70 | 71 |
72 | 73 | -------------------------------------------------------------------------------- /chapter_07/v4/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_07/v4/wicked/skins/blue/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v4/wicked/skins/blue/header.png -------------------------------------------------------------------------------- /chapter_07/v4/wicked/skins/blue/sk8r_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v4/wicked/skins/blue/sk8r_header.png -------------------------------------------------------------------------------- /chapter_07/v4/wicked/skins/blue/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#0033FF;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v4/wicked/skins/red/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v4/wicked/skins/red/header.png -------------------------------------------------------------------------------- /chapter_07/v4/wicked/skins/red/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#FF0000;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v4/wicked/skins/yellow/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v4/wicked/skins/yellow/header.png -------------------------------------------------------------------------------- /chapter_07/v4/wicked/skins/yellow/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#FFFF00;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v4/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_07/v4/wicked/widgets/author-data.php: -------------------------------------------------------------------------------- 1 | 'A widget that displays author info on single posts.' 7 | ); 8 | $this->WP_Widget('author_data', 'Author Data', $widget_ops); 9 | } 10 | 11 | function form($instance) { 12 | $title = esc_attr($instance['title']); 13 | 14 | ?> 15 |

16 | 23 |

24 | '; 44 | echo get_avatar(get_the_author_meta('user_email'), 150); 45 | echo '

' . the_author_meta('display_name') . '

'; 46 | 47 | // Is there an author description? 48 | if (get_the_author_meta('description')) { 49 | echo '

' . get_the_author_meta('description') . '

'; 50 | } 51 | echo ''; 52 | echo $after_widget; 53 | } 54 | } 55 | } 56 | 57 | register_widget('Author_Data_Widget'); 58 | 59 | ?> -------------------------------------------------------------------------------- /chapter_07/v5/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_07/v5/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | 48 | // load the custom options 49 | global $childoptions; 50 | foreach ($childoptions as $value) { 51 | $$value['id'] = get_option($value['id'], $value['std']); 52 | } 53 | 54 | query_posts("posts_per_page=4&cat=" . $wicked_feature_cat); 55 | $counter = 1; 56 | if (have_posts()) : while (have_posts()) : the_post(); ?> 57 |
58 | 62 |
63 | 64 | 65 | 66 |
67 |
68 | 69 |

Eek

70 |

There are no posts to show!

71 | '; 78 | return $content; 79 | } 80 | function wicked_after_title($content) { 81 | $content = ''; return $content; 82 | } 83 | add_filter('thematic_before_title', 'wicked_before_title'); 84 | add_filter('thematic_after_title', 'wicked_after_title'); 85 | 86 | // remove index insert aside 87 | function wicked_remove_index_insert() { 88 | unregister_sidebar('index-insert'); 89 | } 90 | add_action('init', 'wicked_remove_index_insert', 20); 91 | 92 | // add a pullquote shortcode 93 | function pull_quote_sc($atts, $content = null) { 94 | extract(shortcode_atts(array( 95 | 'width' => '600', 96 | 'author' => '', 97 | ), $atts)); 98 | if (!$author == '') { 99 | $authorname = '' . esc_attr($author) . ''; 100 | } else { 101 | $authorname = null; 102 | } 103 | return '
104 |

' . $content . '

' . $authorname . '
'; 105 | } 106 | add_shortcode("pullquote", "pull_quote_sc"); 107 | 108 | // include custom widget areas 109 | include('library/widget-areas.php'); 110 | 111 | // include theme options 112 | include('library/options.php'); 113 | // include style options stylesheets 114 | include('library/style-options.php'); 115 | 116 | ?> -------------------------------------------------------------------------------- /chapter_07/v5/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_07/v5/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v5/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_07/v5/wicked/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v5/wicked/images/header.png -------------------------------------------------------------------------------- /chapter_07/v5/wicked/library/options.php: -------------------------------------------------------------------------------- 1 | cat_ID] = $cat->cat_name; 16 | } 17 | 18 | // the color variants array 19 | $color_variants = array( 20 | "blue" => "blue", 21 | "red" => "red", 22 | "yellow" => "yellow" 23 | ); 24 | 25 | $childoptions = array ( 26 | 27 | array( "name" => __('Color Variant','thematic'), 28 | "desc" => __('Select which color scheme or variant you would like to use.','thematic'), 29 | "id" => "wicked_color_variant", 30 | "std" => 'blue', 31 | "type" => "radio", 32 | "options" => $color_variants 33 | ), 34 | array( "name" => __('Featured Category','thematic'), 35 | "desc" => __('A category of posts to be featured on the front page.','thematic'), 36 | "id" => "wicked_feature_cat", 37 | "std" => $default_cat, 38 | "type" => "select", 39 | "options" => $categories 40 | ) 41 | ); 42 | } 43 | add_action('init', 'childtheme_options'); 44 | 45 | // Make a Theme Options Page 46 | function childtheme_add_admin() { 47 | global $childthemename, $childshortname, $childoptions; 48 | 49 | if ( $_GET['page'] == basename(__FILE__) ) { 50 | 51 | if ( 'save' == $_REQUEST['action'] ) { 52 | // protect against request forgery 53 | check_admin_referer('childtheme-save'); 54 | // save the options 55 | foreach ($childoptions as $value) { 56 | if( isset( $_REQUEST[ $value['id'] ] ) ) { 57 | update_option( $value['id'], $_REQUEST[ $value['id'] ] ); 58 | } else { 59 | delete_option( $value['id'] ); 60 | } 61 | } 62 | 63 | // return to the options page 64 | header("Location: themes.php?page=options.php&saved=true"); 65 | die; 66 | 67 | } else if ( 'reset' == $_REQUEST['action'] ) { 68 | // protect against request forgery 69 | check_admin_referer('childtheme-reset'); 70 | // delete the options 71 | foreach ($childoptions as $value) { 72 | delete_option( $value['id'] ); 73 | } 74 | 75 | // return to the options page 76 | header("Location: themes.php?page=options.php&reset=true"); 77 | die; 78 | } 79 | } 80 | add_theme_page($childthemename." Options", "$childthemename Options", 'edit_themes', basename(__FILE__), 'childtheme_admin'); 81 | } 82 | add_action('admin_menu' , 'childtheme_add_admin'); 83 | 84 | function childtheme_admin() { 85 | 86 | global $childthemename, $childshortname, $childoptions; 87 | 88 | // Saved or Updated message 89 | if ( $_REQUEST['saved'] ) echo '

'.$childthemename.' settings saved.

'; 90 | if ( $_REQUEST['reset'] ) echo '

'.$childthemename.' settings reset.

'; 91 | 92 | // The form 93 | ?> 94 | 95 |
96 |

Options

97 | 98 |
99 | 100 | 101 | 102 | 103 | 110 | 111 | 112 | 116 | 117 | 122 | 123 | 124 | 139 | 140 | 146 | 147 | 148 | 154 | 155 | 160 | 161 | 162 | 174 | 175 | 180 | 181 | 182 | 193 | 194 | 202 | 203 |
: 113 | 114 | 115 |
125 | 137 | 138 |
: 149 | 150 | 153 |
: 163 | $option) { 164 | if ($key == get_option($value['id'], $value['std']) ) { 165 | $checked = "checked=\"checked\""; 166 | } else { 167 | $checked = ""; 168 | } 169 | ?> 170 | />
171 | 172 | 173 |
183 | 190 | /> 191 | 192 |
204 | 205 |

206 | 207 | 208 |

209 | 210 |
211 | 212 |
213 | 214 |

215 | 216 | 217 |

218 |
219 | 220 |

Build Your Own Wicked WordPress Themes. If you have any questions, visit the SitePoint Forums.', 'thematic'); ?>

221 | 222 | -------------------------------------------------------------------------------- /chapter_07/v5/wicked/library/style-options.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_07/v5/wicked/library/widget-areas.php: -------------------------------------------------------------------------------- 1 | 'Main Footer Aside', 7 | 'id' => 'footer-aside', 8 | 'description' => __('A widget area in the footer, above the subsidiary asides.', 'thematic'), 9 | 'before_widget' => thematic_before_widget(), 10 | 'after_widget' => thematic_after_widget(), 11 | 'before_title' => thematic_before_title(), 12 | 'after_title' => thematic_after_title(), ) 13 | ); 14 | } 15 | add_action('init', 'wicked_footer_aside'); 16 | 17 | // Add footer Sidebar Area 18 | function add_wicked_footer_aside() { 19 | if (is_sidebar_active('footer-aside')) { 20 | echo thematic_before_widget_area('footer-aside'); 21 | dynamic_sidebar('footer-aside'); 22 | echo thematic_after_widget_area('footer-aside'); 23 | } 24 | } 25 | add_action('thematic_footer','add_wicked_footer_aside', 10); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_07/v5/wicked/mission-statement.php: -------------------------------------------------------------------------------- 1 | 15 | 16 |
17 | 18 | 19 | 20 |
21 | 22 | 32 | 33 |
34 | 35 | 41 | 42 |
43 | 44 | ".__('Pages: ', 'thematic'), "
\n", 'number'); 49 | 50 | edit_post_link(__('Edit', 'thematic'),'','') ?> 51 | 52 |
53 |
54 | 55 | 66 | 67 |
68 | 69 | 70 | 71 |
72 | 73 | -------------------------------------------------------------------------------- /chapter_07/v5/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_07/v5/wicked/skins/blue/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v5/wicked/skins/blue/header.png -------------------------------------------------------------------------------- /chapter_07/v5/wicked/skins/blue/sk8r_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v5/wicked/skins/blue/sk8r_header.png -------------------------------------------------------------------------------- /chapter_07/v5/wicked/skins/blue/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#0033FF;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v5/wicked/skins/red/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v5/wicked/skins/red/header.png -------------------------------------------------------------------------------- /chapter_07/v5/wicked/skins/red/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#FF0000;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v5/wicked/skins/yellow/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v5/wicked/skins/yellow/header.png -------------------------------------------------------------------------------- /chapter_07/v5/wicked/skins/yellow/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#FFFF00;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v5/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_07/v5/wicked/widgets/author-data.php: -------------------------------------------------------------------------------- 1 | 'A widget that displays author info on single posts.' 7 | ); 8 | $this->WP_Widget('author_data', 'Author Data', $widget_ops); 9 | } 10 | 11 | function form($instance) { 12 | $title = esc_attr($instance['title']); 13 | 14 | ?> 15 |

16 | 23 |

24 | '; 44 | echo get_avatar(get_the_author_meta('user_email'), 150); 45 | echo '

' . the_author_meta('display_name') . '

'; 46 | 47 | // Is there an author description? 48 | if (get_the_author_meta('description')) { 49 | echo '

' . get_the_author_meta('description') . '

'; 50 | } 51 | echo ''; 52 | echo $after_widget; 53 | } 54 | } 55 | } 56 | 57 | register_widget('Author_Data_Widget'); 58 | 59 | ?> -------------------------------------------------------------------------------- /chapter_07/v6/wicked/footer-homepage.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 22 | 23 | '; 30 | } 31 | 32 | ?> 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /chapter_07/v6/wicked/functions.php: -------------------------------------------------------------------------------- 1 | '; 11 | wp_list_pages('depth=1&sort_column=menu_order&title_li='); 12 | echo ''; 13 | } 14 | 15 | // Add a favicon 16 | function wicked_favicon() { 17 | echo ''; 18 | } 19 | add_action('wp_head', 'wicked_favicon'); 20 | 21 | // Add social media links 22 | function wicked_linklove($content) { 23 | if(is_single()) { 24 | $content .= '
25 | Did you love this post? Tell everyone you know, right now! 26 | ⋮ Paste the markup you received from AddThis here. 27 |
'; 28 | } 29 | return $content; 30 | } 31 | add_filter('thematic_post','wicked_linklove', 90); 32 | 33 | // Add an author bio to the end of single post pages 34 | function wicked_showbio($content) { 35 | if (is_single()) { 36 | $content .= '
'; 37 | $content .= '

About ' . get_the_author() . '

'; 38 | $content .= '

' . get_avatar(get_the_author_meta("user_email"), "50"); 39 | $content .= get_the_author_description() .'

'; 40 | } 41 | return $content; 42 | } 43 | add_filter('thematic_post','wicked_showbio', '70'); 44 | 45 | // custom homepage loop 46 | function wicked_indexloop() { 47 | 48 | // load the custom options 49 | global $childoptions; 50 | foreach ($childoptions as $value) { 51 | $$value['id'] = get_option($value['id'], $value['std']); 52 | } 53 | 54 | query_posts("posts_per_page=4&cat=" . $wicked_feature_cat); 55 | $counter = 1; 56 | if (have_posts()) : while (have_posts()) : the_post(); ?> 57 |
58 | 62 |
63 | 64 | 65 | 66 |
67 |
68 | 69 |

Eek

70 |

There are no posts to show!

71 | '; 78 | return $content; 79 | } 80 | function wicked_after_title($content) { 81 | $content = ''; return $content; 82 | } 83 | add_filter('thematic_before_title', 'wicked_before_title'); 84 | add_filter('thematic_after_title', 'wicked_after_title'); 85 | 86 | // remove index insert aside 87 | function wicked_remove_index_insert() { 88 | unregister_sidebar('index-insert'); 89 | } 90 | add_action('init', 'wicked_remove_index_insert', 20); 91 | 92 | // add a pullquote shortcode 93 | function pull_quote_sc($atts, $content = null) { 94 | extract(shortcode_atts(array( 95 | 'width' => '600', 96 | 'author' => '', 97 | ), $atts)); 98 | if (!$author == '') { 99 | $authorname = '' . esc_attr($author) . ''; 100 | } else { 101 | $authorname = null; 102 | } 103 | return '
104 |

' . $content . '

' . $authorname . '
'; 105 | } 106 | add_shortcode("pullquote", "pull_quote_sc"); 107 | 108 | // enable wp_nav_menu 109 | function wicked_change_menu_type() { 110 | return 'wp_nav_menu'; 111 | } 112 | add_filter('thematic_menu_type', 'wicked_change_menu_type'); 113 | 114 | // include custom widget areas 115 | include('library/widget-areas.php'); 116 | 117 | // include theme options 118 | include('library/options.php'); 119 | // include style options stylesheets 120 | include('library/style-options.php'); 121 | 122 | // register the secondary menu 123 | register_nav_menus(array('secondary' => __('Secondary Menu'))); 124 | 125 | // add the secondary menu above the primary sidebar 126 | function wicked_secondary_menu() { 127 | wp_nav_menu(array('theme_location' => 'secondary','fallback_cb'=> '')); 128 | } 129 | add_action('thematic_abovemainasides', 'wicked_secondary_menu'); 130 | 131 | ?> -------------------------------------------------------------------------------- /chapter_07/v6/wicked/home.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 | 14 | 15 |
16 | 17 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | -------------------------------------------------------------------------------- /chapter_07/v6/wicked/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v6/wicked/images/favicon.ico -------------------------------------------------------------------------------- /chapter_07/v6/wicked/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v6/wicked/images/header.png -------------------------------------------------------------------------------- /chapter_07/v6/wicked/library/options.php: -------------------------------------------------------------------------------- 1 | cat_ID] = $cat->cat_name; 16 | } 17 | 18 | // the color variants array 19 | $color_variants = array( 20 | "blue" => "blue", 21 | "red" => "red", 22 | "yellow" => "yellow" 23 | ); 24 | 25 | $childoptions = array ( 26 | 27 | array( "name" => __('Color Variant','thematic'), 28 | "desc" => __('Select which color scheme or variant you would like to use.','thematic'), 29 | "id" => "wicked_color_variant", 30 | "std" => 'blue', 31 | "type" => "radio", 32 | "options" => $color_variants 33 | ), 34 | array( "name" => __('Featured Category','thematic'), 35 | "desc" => __('A category of posts to be featured on the front page.','thematic'), 36 | "id" => "wicked_feature_cat", 37 | "std" => $default_cat, 38 | "type" => "select", 39 | "options" => $categories 40 | ) 41 | ); 42 | } 43 | add_action('init', 'childtheme_options'); 44 | 45 | // Make a Theme Options Page 46 | function childtheme_add_admin() { 47 | global $childthemename, $childshortname, $childoptions; 48 | 49 | if ( $_GET['page'] == basename(__FILE__) ) { 50 | 51 | if ( 'save' == $_REQUEST['action'] ) { 52 | // protect against request forgery 53 | check_admin_referer('childtheme-save'); 54 | // save the options 55 | foreach ($childoptions as $value) { 56 | if( isset( $_REQUEST[ $value['id'] ] ) ) { 57 | update_option( $value['id'], $_REQUEST[ $value['id'] ] ); 58 | } else { 59 | delete_option( $value['id'] ); 60 | } 61 | } 62 | 63 | // return to the options page 64 | header("Location: themes.php?page=options.php&saved=true"); 65 | die; 66 | 67 | } else if ( 'reset' == $_REQUEST['action'] ) { 68 | // protect against request forgery 69 | check_admin_referer('childtheme-reset'); 70 | // delete the options 71 | foreach ($childoptions as $value) { 72 | delete_option( $value['id'] ); 73 | } 74 | 75 | // return to the options page 76 | header("Location: themes.php?page=options.php&reset=true"); 77 | die; 78 | } 79 | } 80 | add_theme_page($childthemename." Options", "$childthemename Options", 'edit_themes', basename(__FILE__), 'childtheme_admin'); 81 | } 82 | add_action('admin_menu' , 'childtheme_add_admin'); 83 | 84 | function childtheme_admin() { 85 | 86 | global $childthemename, $childshortname, $childoptions; 87 | 88 | // Saved or Updated message 89 | if ( $_REQUEST['saved'] ) echo '

'.$childthemename.' settings saved.

'; 90 | if ( $_REQUEST['reset'] ) echo '

'.$childthemename.' settings reset.

'; 91 | 92 | // The form 93 | ?> 94 | 95 |
96 |

Options

97 | 98 |
99 | 100 | 101 | 102 | 103 | 110 | 111 | 112 | 116 | 117 | 122 | 123 | 124 | 139 | 140 | 146 | 147 | 148 | 154 | 155 | 160 | 161 | 162 | 174 | 175 | 180 | 181 | 182 | 193 | 194 | 202 | 203 |
: 113 | 114 | 115 |
125 | 137 | 138 |
: 149 | 150 | 153 |
: 163 | $option) { 164 | if ($key == get_option($value['id'], $value['std']) ) { 165 | $checked = "checked=\"checked\""; 166 | } else { 167 | $checked = ""; 168 | } 169 | ?> 170 | />
171 | 172 | 173 |
183 | 190 | /> 191 | 192 |
204 | 205 |

206 | 207 | 208 |

209 | 210 |
211 | 212 |
213 | 214 |

215 | 216 | 217 |

218 |
219 | 220 |

Build Your Own Wicked WordPress Themes. If you have any questions, visit the SitePoint Forums.', 'thematic'); ?>

221 | 222 | -------------------------------------------------------------------------------- /chapter_07/v6/wicked/library/style-options.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_07/v6/wicked/library/widget-areas.php: -------------------------------------------------------------------------------- 1 | 'Main Footer Aside', 7 | 'id' => 'footer-aside', 8 | 'description' => __('A widget area in the footer, above the subsidiary asides.', 'thematic'), 9 | 'before_widget' => thematic_before_widget(), 10 | 'after_widget' => thematic_after_widget(), 11 | 'before_title' => thematic_before_title(), 12 | 'after_title' => thematic_after_title(), ) 13 | ); 14 | } 15 | add_action('init', 'wicked_footer_aside'); 16 | 17 | // Add footer Sidebar Area 18 | function add_wicked_footer_aside() { 19 | if (is_sidebar_active('footer-aside')) { 20 | echo thematic_before_widget_area('footer-aside'); 21 | dynamic_sidebar('footer-aside'); 22 | echo thematic_after_widget_area('footer-aside'); 23 | } 24 | } 25 | add_action('thematic_footer','add_wicked_footer_aside', 10); 26 | 27 | ?> -------------------------------------------------------------------------------- /chapter_07/v6/wicked/mission-statement.php: -------------------------------------------------------------------------------- 1 | 15 | 16 |
17 | 18 | 19 | 20 |
21 | 22 | 32 | 33 |
34 | 35 | 41 | 42 |
43 | 44 | ".__('Pages: ', 'thematic'), "
\n", 'number'); 49 | 50 | edit_post_link(__('Edit', 'thematic'),'','') ?> 51 | 52 |
53 |
54 | 55 | 66 | 67 |
68 | 69 | 70 | 71 |
72 | 73 | -------------------------------------------------------------------------------- /chapter_07/v6/wicked/readme.txt: -------------------------------------------------------------------------------- 1 | Use these theme files to start your Thematic Child Theme development. 2 | Rename and move this entire folder to the root level of wp-content/themes 3 | alongside Thematic and activate your new Thematic Child Theme like any 4 | other WordPress theme. 5 | 6 | Good luck! 7 | 8 | -- 9 | Ian Stewart 10 | ian@themeshaper.com 11 | http://themeshaper.com/ -------------------------------------------------------------------------------- /chapter_07/v6/wicked/skins/blue/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v6/wicked/skins/blue/header.png -------------------------------------------------------------------------------- /chapter_07/v6/wicked/skins/blue/sk8r_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v6/wicked/skins/blue/sk8r_header.png -------------------------------------------------------------------------------- /chapter_07/v6/wicked/skins/blue/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#0033FF;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v6/wicked/skins/red/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v6/wicked/skins/red/header.png -------------------------------------------------------------------------------- /chapter_07/v6/wicked/skins/red/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#FF0000;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v6/wicked/skins/yellow/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spbooks/wordpress1/b5eb39b9299ad380dc8ab72b462b757a7c37f042/chapter_07/v6/wicked/skins/yellow/header.png -------------------------------------------------------------------------------- /chapter_07/v6/wicked/skins/yellow/skin.css: -------------------------------------------------------------------------------- 1 | a, a:link, a:visited {color:#FFFF00;} 2 | #blog-title { 3 | background:transparent url('header.png') left top no-repeat; 4 | padding-left: 120px; 5 | height: 100px; 6 | } -------------------------------------------------------------------------------- /chapter_07/v6/wicked/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Wicked Theme 3 | Theme URI: http://sitepoint.com/books/wordpress1 4 | Description: A wicked Thematic child theme. 5 | Author: Raena Jackson Armitage 6 | Author URI: http://raena.net 7 | Template: thematic 8 | Version: 0.1 9 | Tags: Thematic, three-columns, blue, grey, gray 10 | . 11 | Thematic is © Ian Stewart http://themeshaper.com/ 12 | . 13 | */ 14 | 15 | /* Reset browser defaults */ 16 | @import url('../thematic/library/styles/reset.css'); 17 | 18 | /* Apply basic typography styles */ 19 | @import url('../thematic/library/styles/typography.css'); 20 | 21 | /* Apply a basic layout */ 22 | @import url('../thematic/library/layouts/2c-l-fixed.css'); 23 | 24 | /* Apply basic image styles */ 25 | @import url('../thematic/library/styles/images.css'); 26 | 27 | /* Apply default theme styles and colors 28 | -- This is a copy of the Thematic default.css file */ 29 | @import url('newstyles.css'); 30 | 31 | /* Prepare theme for plugins */ 32 | @import url('../thematic/library/styles/plugins.css'); 33 | 34 | 35 | -------------------------------------------------------------------------------- /chapter_07/v6/wicked/widgets/author-data.php: -------------------------------------------------------------------------------- 1 | 'A widget that displays author info on single posts.' 7 | ); 8 | $this->WP_Widget('author_data', 'Author Data', $widget_ops); 9 | } 10 | 11 | function form($instance) { 12 | $title = esc_attr($instance['title']); 13 | 14 | ?> 15 |

16 | 23 |

24 | '; 44 | echo get_avatar(get_the_author_meta('user_email'), 150); 45 | echo '

' . the_author_meta('display_name') . '

'; 46 | 47 | // Is there an author description? 48 | if (get_the_author_meta('description')) { 49 | echo '

' . get_the_author_meta('description') . '

'; 50 | } 51 | echo ''; 52 | echo $after_widget; 53 | } 54 | } 55 | } 56 | 57 | register_widget('Author_Data_Widget'); 58 | 59 | ?> --------------------------------------------------------------------------------