By Emran Omari
By Emran Omari <ul><li>WordPress   is a state - of - the - art  publishing platform  with a focus on aesthetics, web stand...
By Emran Omari What I need to use it? <ul><li>WordPress core (Wordpress.org or Ar-wp.com) </li></ul><ul><li>PHP version 4....
By Emran Omari <ul><li>Better for designers  - templates make it far easier. </li></ul><ul><li>Better for developers  - co...
By Emran Omari <ul><li>Client-Side 4 Layers </li></ul><ul><ul><li>Structure  (Markup)=xHtml </li></ul></ul><ul><ul><li>Con...
By Emran Omari Functions generate Dynamic  content  and  sub-markup  using php and MySql WordPress Core Themes <ul><li>xHt...
By Emran Omari WordPress Core (Database) <ul><li>wp_comments </li></ul><ul><li>wp_commentmeta </li></ul><ul><li>wp_links <...
By Emran Omari WordPress Core (Structure) <ul><li>Posts </li></ul><ul><ul><li>pages </li></ul></ul><ul><ul><li>Revisions <...
By Emran Omari Themes (Template Files) <ul><li>index.php </li></ul><ul><li>style.css </li></ul>/* Theme Name: Rose Theme U...
 
By Emran Omari Simple xhtml page
By Emran Omari Short include tags <?php  get_header();  ?>  // header.php <?php  get_footer();  ?>  //footer.php <?php  ge...
By Emran Omari Header.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xh...
By Emran Omari Header.php (dynamic title)
By Emran Omari footer.php <ul><li><?php  get_footer(&quot;lite&quot;);  ?>  //footer-lite.php </li></ul><ul><li><?php  get...
By Emran Omari sidebar.php <?php  get_sidebar(‘altern’);  ?>  //sidebar-altern.php <div  id=&quot;sidebar&quot; > *categor...
By Emran Omari wp_get_archives <ul><li><?php  wp_get_archives(array( </li></ul><ul><ul><li>'type' => 'postbypost', // or d...
By Emran Omari wp_tag_cloud <ul><li><?php  wp_tag_cloud(array( </li></ul><ul><ul><li>'smallest' => 10, // size of least us...
By Emran Omari wp_list_categories <ul><li><?php  wp_list_categories (array( </li></ul><ul><ul><li>'orderby' => 'name', // ...
By Emran Omari wp_list_bookmarks <ul><li><?php  wp_list_bookmarks(array( </li></ul><ul><ul><li>'orderby' => 'name', // alp...
By Emran Omari Widgets (step 1) <ul><li><div id=&quot;sidebar&quot;> </li></ul><ul><ul><li><?php  if (!function_exists('dy...
By Emran Omari Index.php <?php  get_header();  ?>  *Content (the loop) <?php  get_sidebar();  ?> <?php  get_footer();  ?> ...
By Emran Omari The loop <ul><ul><ul><ul><ul><li><?php  if (have_posts()) : while (have_posts()) : the_post();  ?>   </li><...
By Emran Omari Inside The loop <ul><ul><ul><ul><ul><li>$post  (id, post_name, post_modified…) </li></ul></ul></ul></ul></u...
 
By Emran Omari Single.php (comment form) <ul><li><?php   </li></ul><ul><ul><li>if (have_posts()) : while (have_posts()) : ...
By Emran Omari Comment Logic <ul><ul><ul><ul><ul><li>Is the post protected? (password required) </li></ul></ul></ul></ul><...
By Emran Omari Customizing the Loop <ul><ul><ul><ul><ul><li><?php </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>//...
By Emran Omari Multi Loops <ul><ul><ul><ul><ul><li><?php </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>query_posts...
By Emran Omari Other subjects to extend themes <ul><ul><ul><ul><ul><li>Function.php </li></ul></ul></ul></ul></ul><ul><ul>...
Upcoming SlideShare
Loading in...5
×

Wordpress

5,523

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,523
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Wordpress

  1. 1. By Emran Omari
  2. 2. By Emran Omari <ul><li>WordPress is a state - of - the - art publishing platform with a focus on aesthetics, web standards, and usability . WordPress is both free and priceless at the same time. (wordpress team) </li></ul>What is WordPress? <ul><li>WordPress, has emerged as a preferred platform for content production and continues to evolve to meet our ever-changing content needs. (wordpress bible) </li></ul><ul><li>WordPress is free, open source, and has fostered a giant community around it , you’ll always be in good hands. ( digging into wordpress) </li></ul>
  3. 3. By Emran Omari What I need to use it? <ul><li>WordPress core (Wordpress.org or Ar-wp.com) </li></ul><ul><li>PHP version 4.3 or greater </li></ul><ul><li>MySQL version 4.1.2 or greater </li></ul><ul><li>Local Server (test environment) </li></ul><ul><li>Xampp </li></ul><ul><li>Wamp/Lamp </li></ul><ul><li>Camel(Arabic) </li></ul>
  4. 4. By Emran Omari <ul><li>Better for designers - templates make it far easier. </li></ul><ul><li>Better for developers - content in databases. </li></ul><ul><li>Better for site managers - publishing tools. </li></ul><ul><li>Better for visitors </li></ul>Static vs dynamic sites.
  5. 5. By Emran Omari <ul><li>Client-Side 4 Layers </li></ul><ul><ul><li>Structure (Markup)=xHtml </li></ul></ul><ul><ul><li>Content =enclosed by markup </li></ul></ul><ul><ul><li>Presentation =CSS </li></ul></ul><ul><ul><li>Behavior = JavaScript </li></ul></ul>First Things First xHtml, CSS, JS and PHP
  6. 6. By Emran Omari Functions generate Dynamic content and sub-markup using php and MySql WordPress Core Themes <ul><li>xHtml Markup </li></ul><ul><li>Css Presentation </li></ul><ul><li>Javascript behavior </li></ul>
  7. 7. By Emran Omari WordPress Core (Database) <ul><li>wp_comments </li></ul><ul><li>wp_commentmeta </li></ul><ul><li>wp_links </li></ul><ul><li>wp_posts </li></ul><ul><li>wp_postmeta </li></ul><ul><li>wp_terms </li></ul><ul><li>wp_term_relationships </li></ul><ul><li>wp_term_taxonomy </li></ul><ul><li>wp_users </li></ul><ul><li>wp_usermeta </li></ul><ul><li>wp_options </li></ul>
  8. 8. By Emran Omari WordPress Core (Structure) <ul><li>Posts </li></ul><ul><ul><li>pages </li></ul></ul><ul><ul><li>Revisions </li></ul></ul><ul><ul><li>Attachement </li></ul></ul><ul><ul><li>Nav Menus </li></ul></ul><ul><ul><li>+ our post types </li></ul></ul><ul><li>Links </li></ul><ul><li>Comments </li></ul><ul><li>Users </li></ul><ul><li>Taxonomies </li></ul><ul><ul><li>Categories </li></ul></ul><ul><ul><li>Tags </li></ul></ul><ul><ul><li>Link Categories </li></ul></ul><ul><ul><li>+ our taxonomies </li></ul></ul>
  9. 9. By Emran Omari Themes (Template Files) <ul><li>index.php </li></ul><ul><li>style.css </li></ul>/* Theme Name: Rose Theme URI: the-theme's-homepage Description: a-brief-description Author: your-name Author URI: your-URI Template: parent-theme—optional Version: a-number—optional. General comments/License Statement if any. . */ /* Code Css */ => Simple xhtml page + wp functions
  10. 11. By Emran Omari Simple xhtml page
  11. 12. By Emran Omari Short include tags <?php get_header();  ?> // header.php <?php get_footer();  ?> //footer.php <?php get_sidebar();  ?> //sidebar.php <?php comments_template(); ?> //comments.php <?php get_search_form(); ?> //searchform.php <?php include ( TEMPLATEPATH . '/file.php');  ?>
  12. 13. By Emran Omari Header.php <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; <?php language_attributes(); ?> > <head> <title> Welcome </title> <meta http-equiv=&quot;Content-Type&quot; content=&quot; <?php bloginfo('html_type'); ?> ; charset= <?php bloginfo('charset'); ?> &quot; /> <link rel='stylesheet' href=' <?php bloginfo(&quot;stylesheet_url&quot;); ?> ' type='text/css' media='screen' /> <?php wp_enqueue_script('jquery'); ?> <?php wp_head(); ?> </head>
  13. 14. By Emran Omari Header.php (dynamic title)
  14. 15. By Emran Omari footer.php <ul><li><?php get_footer(&quot;lite&quot;); ?> //footer-lite.php </li></ul><ul><li><?php get_footer(&quot;full&quot;); ?> //footer-full.php </li></ul><ul><ul><li><div id=&quot;footer&quot; > </li></ul></ul><ul><ul><li><?php wp_footer(); ?> </li></ul></ul><ul><ul><li></div> </li></ul></ul><ul><li></body></html> </li></ul>
  15. 16. By Emran Omari sidebar.php <?php get_sidebar(‘altern’); ?> //sidebar-altern.php <div id=&quot;sidebar&quot; > *categories *pages *tags *Typed-taxonomies *static or dynamic adds *………. </div>
  16. 17. By Emran Omari wp_get_archives <ul><li><?php wp_get_archives(array( </li></ul><ul><ul><li>'type' => 'postbypost', // or daily, weekly, monthly, yearly </li></ul></ul><ul><ul><li>'limit' => 10, // maximum number shown </li></ul></ul><ul><ul><li>'format' => 'html', // or select (dropdown), link, or custom </li></ul></ul><ul><ul><li>'show_post_count' => false, // show number of posts per link </li></ul></ul><ul><ul><li>'echo' => 1 // display results or return array </li></ul></ul><ul><li>)); ?> </li></ul><ul><li>Old-school method </li></ul><ul><li><?php wp_get_archives(“type=postbypost&limit=10” ); ?> </li></ul>
  17. 18. By Emran Omari wp_tag_cloud <ul><li><?php wp_tag_cloud(array( </li></ul><ul><ul><li>'smallest' => 10, // size of least used tag </li></ul></ul><ul><ul><li>'largest' => 18, // size of most used tag </li></ul></ul><ul><ul><li>'unit' => 'px', // unit for sizing </li></ul></ul><ul><ul><li>'orderby' => 'name', // alphabetical </li></ul></ul><ul><ul><li>'order' => 'ASC', // starting at A </li></ul></ul><ul><ul><li>'exclude' => 6' // ID of tag to exclude from list </li></ul></ul><ul><ul><li>'taxonomy'  => 'post_tag' //name of typed taxonomy </li></ul></ul><ul><ul><li>)); ?> </li></ul></ul>
  18. 19. By Emran Omari wp_list_categories <ul><li><?php wp_list_categories (array( </li></ul><ul><ul><li>'orderby' => 'name', // alphabetical </li></ul></ul><ul><ul><li>'order' => 'ASC', // starting at A </li></ul></ul><ul><ul><li>'show_count' => 0, // do NOT show # of posts per cat </li></ul></ul><ul><ul><li>'title_li' => __('Categories'), // include title list item </li></ul></ul><ul><ul><li>'exclude' => 12, // ID of category to exclude </li></ul></ul><ul><ul><li>'depth' => 0 // levels deep to go down cat tree </li></ul></ul><ul><ul><li>)); ?> </li></ul></ul>
  19. 20. By Emran Omari wp_list_bookmarks <ul><li><?php wp_list_bookmarks(array( </li></ul><ul><ul><li>'orderby' => 'name', // alphabetical </li></ul></ul><ul><ul><li>'order' => 'ASC', // starting at A </li></ul></ul><ul><ul><li>'limit' => -1, // unlimited, show ALL bookmarks </li></ul></ul><ul><ul><li>'title_li' => __('Bookmarks'), // include list item title </li></ul></ul><ul><ul><li>'title_before' => '<h2>', // tag before title </li></ul></ul><ul><ul><li>'title_after' => '</h2>', // tag after title </li></ul></ul><ul><li>)); ?> </li></ul>
  20. 21. By Emran Omari Widgets (step 1) <ul><li><div id=&quot;sidebar&quot;> </li></ul><ul><ul><li><?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?> </li></ul></ul><ul><ul><li>*categories </li></ul></ul><ul><ul><li>*pages </li></ul></ul><ul><ul><li>*tags </li></ul></ul><ul><ul><li>*Typed-taxonomies </li></ul></ul><ul><ul><li>*static or dynamic adds </li></ul></ul><ul><ul><li>*………. </li></ul></ul><ul><ul><li><?php endif; ?> </li></ul></ul><ul><li></div> </li></ul>
  21. 22. By Emran Omari Index.php <?php get_header();  ?> *Content (the loop) <?php get_sidebar();  ?> <?php get_footer();  ?> <ul><li><?php </li></ul><ul><ul><li>if (have_posts()) : while (have_posts()) : the_post(); </li></ul></ul><ul><ul><li>* post-by-post </li></ul></ul><ul><ul><li>endwhile; else: </li></ul></ul><ul><ul><li>* nothing found </li></ul></ul><ul><ul><li>endif; </li></ul></ul><ul><li>?> </li></ul>The loop
  22. 23. By Emran Omari The loop <ul><ul><ul><ul><ul><li><?php if (have_posts()) : while (have_posts()) : the_post(); ?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><div class=&quot;post&quot; id=&quot;post-<?php the_ID(); ?>&quot; > </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><h2> <?php the_title(); ?> </h2> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><p> at <?php the_time('F jS, Y'); ?> by <?php the_author(); ?> </p> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><?php the_content('Read Full Article'); ?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><p> <?php the_tags('Tags: ', ', ', '<br />'); ?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Posted in <?php the_category(', '); ?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>| <?php comments_popup_link('No Comments;', '1 Comment', '% Comments'); ?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li></p> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li></div> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><?php endwhile; ?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><?php next_posts_link('Older Entries'); ?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><?php previous_posts_link('Newer Entries'); ?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><?php else : ?> <h2> Nothing Found </h2> <?php endif; ?> </li></ul></ul></ul></ul></ul>
  23. 24. By Emran Omari Inside The loop <ul><ul><ul><ul><ul><li>$post (id, post_name, post_modified…) </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>the_permalink() </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>the_ID() </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>the_author() </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>the_category() </li></ul></ul></ul></ul></ul>OutSide The loop <ul><ul><ul><ul><ul><li>next_posts_link(‘ '); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>previous_posts_link(‘ '); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>$query_string </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>posts_per_page=5&what_to_show=posts&orderby=date&order=DESC </li></ul></ul></ul></ul></ul>
  24. 26. By Emran Omari Single.php (comment form) <ul><li><?php </li></ul><ul><ul><li>if (have_posts()) : while (have_posts()) : the_post(); </li></ul></ul><ul><ul><li>* post-by-post </li></ul></ul><ul><ul><li>?> </li></ul></ul><ul><ul><li><div id=&quot;comment-box&quot;> </li></ul></ul><ul><ul><li> <?php comments_template(); ?> </li></ul></ul><ul><ul><li></div> </li></ul></ul><ul><li><?php </li></ul><ul><ul><li>endwhile; else: </li></ul></ul><ul><ul><li>* nothing found </li></ul></ul><ul><ul><li>endif; </li></ul></ul><ul><li>?> </li></ul><ul><li>Show Comments in multi post pages </li></ul><ul><li><?php $withcomments = 1; ?> </li></ul>
  25. 27. By Emran Omari Comment Logic <ul><ul><ul><ul><ul><li>Is the post protected? (password required) </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Yes - display message and stop </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>No - continue </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Are there any comments? </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Yes - Display them and continue </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>No - don’t display anything and continue </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Are comments open? </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Yes – continue </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>No - display message and stop </li></ul></ul></ul></ul></ul><ul><li>Is registration required? </li></ul><ul><li>Yes - display message and stop </li></ul><ul><li>No - display comment form </li></ul>
  26. 28. By Emran Omari Customizing the Loop <ul><ul><ul><ul><ul><li><?php </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>// The Query - Customize! </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>query_posts('showposts=5&cat=3'); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>// The Loop </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>if (have_posts()) : while (have_posts()) : the_post(); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>... </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>endwhile; else: </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>... </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>endif; </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>// Reset Query </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>wp_reset_query(); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Add With preserve </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>query_posts($query_string . '&showposts=6'); </li></ul></ul></ul></ul></ul>
  27. 29. By Emran Omari Multi Loops <ul><ul><ul><ul><ul><li><?php </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>query_posts(array( </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>'cat': 2, </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>'posts_per_page': 7 </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>)); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><?php </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>query_posts(array( </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>'cat': -2, </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>'posts_per_page': 5 </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>)); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><?php </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>query_posts(array( </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>'cat': -2, 'offset': 5, </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>'posts_per_page': 5 </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>)); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>?> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><?php </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>query_posts(array( </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>'cat': -2, 'offset': 10, </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>'posts_per_page': 5 </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>)); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>?> </li></ul></ul></ul></ul></ul>
  28. 30. By Emran Omari Other subjects to extend themes <ul><ul><ul><ul><ul><li>Function.php </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Register taxonomy </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>GD Custom Posts And Taxonomies Tools </li></ul></ul></ul></ul></ul><ul><li>Custom Post Type UI </li></ul><ul><ul><ul><ul><ul><li>Register Post Type </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Override wordpress functions </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Page-templates </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Custimize comments (delete & edit links) </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>shortcode (add_shortcode('home', ‘callBackStringFunctions');) </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Conditional tags (is_single….) </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Custom fileds ( get_post_meta($post->ID, ‘nosidebar', true); ) </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Hooks, Actions and Filters (add_action, add_filter) </li></ul></ul></ul></ul></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×