• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
What we can learn from WordPress as a developer
 

What we can learn from WordPress as a developer

on

  • 652 views

What we can learn from WordPress - become a better developer.

What we can learn from WordPress - become a better developer.

Statistics

Views

Total Views
652
Views on SlideShare
652
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

    What we can learn from WordPress as a developer What we can learn from WordPress as a developer Presentation Transcript

    • What we can learn from WordPress Chandra Maharzan tweet @maharzanSunday, March 25, 12
    • Sunday, March 25, 12
    • Sunday, March 25, 12
    • What we ignore • Most simplest parts • Comments • White Space • Proper NamesSunday, March 25, 12
    • CSSSunday, March 25, 12
    • /* =Quote ----------------------------- */ .format-quote blockquote { ! color: #555; /* red color */ ! font-size: 17px; ! margin: 0; } /* =Image ----------------------------- */Sunday, March 25, 12
    • /* =Menu ----------------------------- */ #access ul ul ul { ! left: 100%; ! top: 0; } /* Search Form */ #branding #searchform { ! position: absolute; ! top: 3.8em; ! right: 7.6%; }Sunday, March 25, 12
    • selector { property: value; } #selector-1, #selector-2, #selector-3 { background: #fff; color: #000; } #selector-1 { background: #fff; color: #000; }Sunday, March 25, 12
    • Class names #comment-form { margin: 0; } #commentForm {} #comment_form {} #abc-12 {}Sunday, March 25, 12
    • Property : Value #comment-form { -moz-box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2); box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2); font-size: 1em; position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 500px; height: auto; }Sunday, March 25, 12
    • Useful Resources •Firebug • http://codex.wordpress.org/ CSS_Coding_StandardsSunday, March 25, 12
    • PHPSunday, March 25, 12
    • Comments /** * Tell WordPress to run twentyeleven_setup() when the * after_setup_theme hook is run. */ add_action( after_setup_theme, twentyeleven_setup ); /** * Sets the post excerpt length to 40 words. * * To override this length in a child theme, * remove the filter and add your own * function tied to the excerpt_length filter hook. */ function twentyeleven_excerpt_length( $length ) {Sunday, March 25, 12
    • Comments // Turn on random header image rotation by default. add_theme_support( custom-header, array( random- default => true ) ); // Has the text been hidden? if ( blank == get_header_textcolor() ) : ... ... // If the user has set a custom color for the text use else : .... .... endif;Sunday, March 25, 12
    • Comments /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */ <div id="primary"> ! <div id="content" role="main"> ..... ..... </div><!-- #content --> </div><!-- #primary -->Sunday, March 25, 12
    • Variables $foo=somevalue; $foo2=somevalue2; $foo34var=somevalue3; $nicevar=somevalue4; $my_array=array( foo=>somevalue, foo2=>somevalue2, foo3=>somevalue3, foo34=>somevalue3 );Sunday, March 25, 12
    • Better? $foo = somevalue; $foo2 = somevalue2; $foo34var = somevalue3; $nicevar = somevalue4; $my_array = array( foo => somevalue, foo2 => somevalue2, foo3 => somevalue3, foo34 => somevalue3 );Sunday, March 25, 12
    • HTML <?php if ( ! have_posts() ) : ?> <div id="post-1" class="post"> <h1 class="entry-title">Not Found</h1> <div class="entry-content"> <p>Apologies, but no results were found.</p> <?php get_search_form(); ?> </div> </div> <?php endif; ?>Sunday, March 25, 12
    • White Space function te_custom_excerpt( $output ) { ! if ( has_excerpt() && ! is_attachment() ) { ! $output .= te_continue_reading_link(); ! } ! return $output; } add_filter( get_the_excerpt, te_custom_excerpt );Sunday, March 25, 12
    • In General •x == 23 •foo && bar •! foo •function( $a, $b, $c ) •$concat . -5 •$term .= XSunday, March 25, 12
    • Reference • http://codex.wordpress.org/ WordPress_Coding_StandardsSunday, March 25, 12
    • Thank youSunday, March 25, 12