Jared	  Atchison	  	  /	  	  jaredatchison.com	  	  /	  	  @jaredatch	  
Wait,	  who?	  
Wait,	  who?	  —  2008	  Texas	  A&M	  Graduate	  (Technology	  Management)	  —  M-­‐F,	  8-­‐5pm:	  Texas	  Transportat...
Common	  Mistakes	  
Adding	  JavaScript	  to	  themes	  wp-­‐content/themes/YourTheme/header.php	  
Adding	  JavaScript	  to	  themes	  wp-­‐content/themes/YourTheme/functions.php	    —  Still	  not	  ideal	    —  Can	  ...
Adding	  JavaScript	  to	  themes	  wp_enqueue_script()	  -­‐	  http://codex.wordpress.org/Function_Reference/wp_enqueue_s...
Adding	  JavaScript	  to	  themes	  
WP	  packaged	  jQuery	  	  —  WordPress	  ships	  with	  jQuery	  (1.4.2)	     —  /wp-­‐includes/js/jquery/jquery.js	  ...
WP	  packaged	  jQuery	  	  WHY	  REMOVE?	  —  Wants/needs	  the	  newest	  version	  (e.g.	  1.4.4)	  —  Wants	  to	  b...
WP	  packaged	  jQuery	  	  WHY	  NOT	  REMOVE?	  —  Adding	  JS	  the	  wrong	  way	  (first	  point)	  can	  cause	  cha...
WP	  packaged	  jQuery	  	     IF	  NEEDED,	  DO	  IT	  CORRECTLY	  :)	           	  http://codex.wordpress.org/Function_R...
WP	  packaged	  jQuery	  	  WORKING	  WITH	  NO	  CONFLICT	  —  Virtually	  all	  popular	  jQuery	  scripts	  work	  in	...
Including	  files	  —  Can	  be	  done	  many	  different	  ways	  (successfully).	  —  Certain	  methods	  for	  certain	...
Using	  Permalinks	  —  WordPress	  gives	  great	  permalink	  control	  —  You	  can	  do	  almost	  anything	  –	  bu...
Using	  Permalinks	  “Use	  a	  permalink	  structure	  that	  does	  not	  start	  with	  a	  text	  based	  variable.	  ...
Building	  a	  theme	  —  Don’t	  start	  from	  scratch	  unless	  you	  must	  —  Build	  on	  top	  of	  something	  ...
Troubleshooting	  (do	  it)	  —  Errors?	  Warnings?	  Notices?	  White-­‐screen-­‐of-­‐death?	  —  DON’T	  PANIC.	  Dee...
Getting	  Help	  —  Know	  where	  to	  go	  for	  help.	  All	  sources	  are	  not	  equal!	  —  Codex	  (	  http://co...
Staying	  informed	  —  Twitter,	  #wordpress	      —  http://twitter.com/#!/jaredatch/wordpress	  —  Mailing	  lists,	...
Helpful	  WordPress	  sites	  —  WP	  Candy	            —  Dougal	  Campbell	  —  WP	  Tavern	           —  Lorelle	  ...
Jared	  Atchison	  	  /	  	  jaredatchison.com	  	  /	  	  @jaredatch	  
WordPress Tips & Tricks
WordPress Tips & Tricks
WordPress Tips & Tricks
Upcoming SlideShare
Loading in...5
×

WordPress Tips & Tricks

1,651

Published on

Presentation at Houston Website & Graphic Design Seminar 2011

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
1,651
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

WordPress Tips & Tricks

  1. 1. Jared  Atchison    /    jaredatchison.com    /    @jaredatch  
  2. 2. Wait,  who?  
  3. 3. Wait,  who?  —  2008  Texas  A&M  Graduate  (Technology  Management)  —  M-­‐F,  8-­‐5pm:  Texas  Transportation  Institute   —  WordPress!  —  Independent  WordPress  Developer/Consultant   —  Genesis!  —  ThemeGarden  Author  http://www.themegarden.com/jared-­‐atchison/  —  Featured  StudioPress  Developer  http://dev.studiopress.com/developers/jared-­‐atchison  —  Theme  frameworks++    
  4. 4. Common  Mistakes  
  5. 5. Adding  JavaScript  to  themes  wp-­‐content/themes/YourTheme/header.php  
  6. 6. Adding  JavaScript  to  themes  wp-­‐content/themes/YourTheme/functions.php   —  Still  not  ideal   —  Can  be  useful  (e.g.  TypeKit)  
  7. 7. Adding  JavaScript  to  themes  wp_enqueue_script()  -­‐  http://codex.wordpress.org/Function_Reference/wp_enqueue_script    wp_register_script()  -­‐  http://codex.wordpress.org/Function_Reference/wp_register_script      
  8. 8. Adding  JavaScript  to  themes  
  9. 9. WP  packaged  jQuery    —  WordPress  ships  with  jQuery  (1.4.2)   —  /wp-­‐includes/js/jquery/jquery.js  —  wp_enqueue_script(‘jquery’);  —  Most  often  replaced  with  copy  from  Google  CDN   —  https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js  
  10. 10. WP  packaged  jQuery    WHY  REMOVE?  —  Wants/needs  the  newest  version  (e.g.  1.4.4)  —  Wants  to  be  on  CDN  (content  delivery  network)   —  “decreased  latency,  increased  parallelism,  and  better  caching.”   —  http://encosia.com/2008/12/10/3-­‐reasons-­‐why-­‐you-­‐should-­‐let-­‐google-­‐host-­‐jquery-­‐for-­‐you/  —  WTFBBQ!!  jQuery.noConflict();  -­‐  no  conflict  mode   —  http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers   —  http://docs.jquery.com/Using_jQuery_with_Other_Libraries  —  Doesn’t  understand/use  wp_enqueue_script();    
  11. 11. WP  packaged  jQuery    WHY  NOT  REMOVE?  —  Adding  JS  the  wrong  way  (first  point)  can  cause  chaos.   —  Duplicate  jQuery  includes,  OH  NOES!   —  ThemeForest.net  …  *face  palm*  —  Public  CDN  not  always  “be  all  and  end  all”.   —  Relying  on  Google   —  Look  into  W3  Total  Cache  —  Cross  library  compatibly  often  lost  (no  conflict)  
  12. 12. WP  packaged  jQuery     IF  NEEDED,  DO  IT  CORRECTLY  :)    http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Load_a_default_WordPress_script_from_a_non-­‐default_location    
  13. 13. WP  packaged  jQuery    WORKING  WITH  NO  CONFLICT  —  Virtually  all  popular  jQuery  scripts  work  in  NC   mode    —  Yours  can  too!  Use  long-­‐hand  document  ready…    
  14. 14. Including  files  —  Can  be  done  many  different  ways  (successfully).  —  Certain  methods  for  certain  situations  —  include();  —  require_once();  —  get_header();  get_sidebar();  and  get_footer()  —  get_template_part();  Since  3.0  
  15. 15. Using  Permalinks  —  WordPress  gives  great  permalink  control  —  You  can  do  almost  anything  –  but  should  you?  —  ZOMG!  BUT  SEO!!!!!   —  Lies.   —  http://www.weberz.com/blog/2009/06/seo-­‐experts-­‐give-­‐wrong-­‐advice-­‐wordpress-­‐permalinks  —  Do  not  start  permalinks  with     %category%  or  %postname%  —  Pages  +  non-­‐numerical  starting  permalinks  =  tons  extra   rules  —  Custom  post  types  excluded  
  16. 16. Using  Permalinks  “Use  a  permalink  structure  that  does  not  start  with  a  text  based  variable.    By  doing  this  you  will  drastically  reduce  your  risk  of  the  problems  listed  above.    Here  is  a  list  of  variables  you  can  use  that  are  not  text  based:”  %year%  –  The  year  of  the  post,  four  digits,  for  example  2004  %monthnum%  –  Month  of  the  year,  for  example  05    %day%  –  Day  of  the  month,  for  example  28    %hour%  –  Hour  of  the  day,  for  example  15    %minute%  –  Minute  of  the  hour,  for  example  43    %second%  –  Second  of  the  minute,  for  example  33    %post_id%  –  The  unique  ID  #  of  the  post,  for  example  423      Further  Reading:  http://ottopress.com/2010/category-­‐in-­‐permalinks-­‐considered-­‐harmful/  Thanks  to  Josh  and  Bill    
  17. 17. Building  a  theme  —  Don’t  start  from  scratch  unless  you  must  —  Build  on  top  of  something  proven!  —  “Blank”  themes:  Whiteboard,  Sandbox,  Starkers,  etc  —  Frameworks:  Genesis!,  Canvas,  Builder,  Hybrid,  Headway,   Thematic  —  On  top  of  popular  themes:  Twenty  Ten  —  Beware  of  Kubrick!  —  http://wpcandy.com/presents/wordpress-­‐theme-­‐framework-­‐comparison    
  18. 18. Troubleshooting  (do  it)  —  Errors?  Warnings?  Notices?  White-­‐screen-­‐of-­‐death?  —  DON’T  PANIC.  Deep  breaths.  Debug!  —  Most  problems  you  can  debug  yourself.  —  define(WP_DEBUG,  true);  —  Deactivate  plugins  —  Deactivate  themes  
  19. 19. Getting  Help  —  Know  where  to  go  for  help.  All  sources  are  not  equal!  —  Codex  (  http://codex.wordpress.org)  —  WordPress  forums/support  (http://wordpress.org/support/)  —  Twitter  e.g.  #wordpress  (hit  or  miss)  —  IRC,  #wordpress  on  irc.freenode.net   —  http://codex.wordpress.org/IRC  —  “3rd  party”  WP  Tavern,  StudioPress  forums,  Google,  etc  
  20. 20. Staying  informed  —  Twitter,  #wordpress   —  http://twitter.com/#!/jaredatch/wordpress  —  Mailing  lists,  wp-­‐testers,  wp-­‐hackers  –  with  caution!  —  Follow  weekly  developer  meetings  (IRC)   —  http://wpdevel.wordpress.com/  —  Read  developer  blogs    
  21. 21. Helpful  WordPress  sites  —  WP  Candy   —  Dougal  Campbell  —  WP  Tavern   —  Lorelle  —  Bill  Erickson   —  Scribu  —  Stephanie  Leary   —  Matt  Mullenweg  —  Yoast   —  Justin  Tadlock  —  Ottopress   —  Alex  Mills   (Viper007Bond)  —  Mark  Jaquith   —  Andrew  Nacin  
  22. 22. Jared  Atchison    /    jaredatchison.com    /    @jaredatch  

×