Download presentation
Presentation is loading. Please wait.
Published byAlexander O’Neal’ Modified over 9 years ago
1
WordPress Architecture ► Core files – PHP ► MySQL database Configured by the installation script ► wp-content directory themes subdirectory: layout plugins subdirectory: extensions uploads subdirectory: uploaded files ► Version updates relatively painless
2
Presentation: Choose a Theme Current Theme Default Themes 100’s available Administrator’s View
3
Theme Architecture ► Set of files installed in a subdirectory of wp-content/themes ► Typical theme set includes style.css and required images PHP template files defining parts of the pages ► header, footer, sidebar, comments PHP template files defining entire pages ► Runtime selection based on template hierarchy template hierarchytemplate hierarchy ► Can also set page template when creating the page Administrator’s View
4
Template Architecture ► Not Smarty But does serve to separate content generation from presentation ► Dozens of predefined tags Simple example: get_header() ► Called “tags,” but most are functions Example: list categories ► list_cats() – 18 positional parameters ► wp_list_cats() – arguments as name/value pairs Administrator’s View
5
Editing Templates Administrator’s View
6
Example template: page.php "> "> ', ' '); ?> ', ' '); ?> Administrator’s View
7
► get_header ► get_sidebar ► the_title ► the_content ► edit_post_link ► get_footer
8
Digression: The Loop Administrator’s View …. ► Applies to “WordPress Pages” as well as “pages” that display “WordPress Posts” ► Many tags to control what happens inside is_category() is_page() More conditional tags conditional tagsconditional tags
9
Extensibility: Plugins Administrator’s View
10
Sample Plugin: Hello, Dolly Administrator’s View $lyrics = explode("\n", $lyrics); $chosen = wptexturize( $lyrics[ mt_rand(0, count($lyrics) ) ] ); function hello_dolly() { global $chosen; echo " $chosen "; } add_action('admin_footer', 'hello_dolly'); function dolly_css() { echo " echo " #dolly { … style attributes … } </style>";} add_action('admin_head', 'dolly_css');
11
“Hello, Dolly” in action ► Before activation ► After activation Administrator’s View
12
Customizing Your Site Other Options Links Quotes Calendar RSS Feeds Book List
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.