Your SlideShare is downloading. ×
0
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
What we can learn from WordPress as a developer
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

What we can learn from WordPress as a developer

526

Published on

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

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

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
526
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. What we can learn from WordPress Chandra Maharzan tweet @maharzanSunday, March 25, 12
  • 2. Sunday, March 25, 12
  • 3. Sunday, March 25, 12
  • 4. What we ignore • Most simplest parts • Comments • White Space • Proper NamesSunday, March 25, 12
  • 5. CSSSunday, March 25, 12
  • 6. /* =Quote ----------------------------- */ .format-quote blockquote { ! color: #555; /* red color */ ! font-size: 17px; ! margin: 0; } /* =Image ----------------------------- */Sunday, March 25, 12
  • 7. /* =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
  • 8. selector { property: value; } #selector-1, #selector-2, #selector-3 { background: #fff; color: #000; } #selector-1 { background: #fff; color: #000; }Sunday, March 25, 12
  • 9. Class names #comment-form { margin: 0; } #commentForm {} #comment_form {} #abc-12 {}Sunday, March 25, 12
  • 10. 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
  • 11. Useful Resources •Firebug • http://codex.wordpress.org/ CSS_Coding_StandardsSunday, March 25, 12
  • 12. PHPSunday, March 25, 12
  • 13. 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
  • 14. 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
  • 15. 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
  • 16. Variables $foo=somevalue; $foo2=somevalue2; $foo34var=somevalue3; $nicevar=somevalue4; $my_array=array( foo=>somevalue, foo2=>somevalue2, foo3=>somevalue3, foo34=>somevalue3 );Sunday, March 25, 12
  • 17. Better? $foo = somevalue; $foo2 = somevalue2; $foo34var = somevalue3; $nicevar = somevalue4; $my_array = array( foo => somevalue, foo2 => somevalue2, foo3 => somevalue3, foo34 => somevalue3 );Sunday, March 25, 12
  • 18. 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
  • 19. 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
  • 20. In General •x == 23 •foo && bar •! foo •function( $a, $b, $c ) •$concat . -5 •$term .= XSunday, March 25, 12
  • 21. Reference • http://codex.wordpress.org/ WordPress_Coding_StandardsSunday, March 25, 12
  • 22. Thank youSunday, March 25, 12

×