Wordpress
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Wordpress

on

  • 5,384 views

 

Statistics

Views

Total Views
5,384
Views on SlideShare
5,384
Embed Views
0

Actions

Likes
1
Downloads
11
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Wordpress Presentation Transcript

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