<?php + WordPress        Christopher Reding   http://christopherreding.com         twitter: @creding
What is PHP• PHP ( Hypertext Pre-processor )     is a  server side scripting language. Server side  means it runs on the s...
What can I do With          PHP•   conditional statements ( if this do that )•   create html for the browser•   retrieve d...
Common PHP in           WordPress•   conditional statements - <?php if ( have_posts() ):•   loops - <?php while ( have_pos...
Places to learn about            PHP?•   http://codex.WordPress.org/Function_Reference•   http://www.php.net•   http://www...
Solving Problems•   http://stackoverflow.com/questions/tagged/php•   http://google.comThe best source for finding the answe...
Tools for the source  •   http://core.trac.WordPress.org/browser  •   http://wpseek.comexample: say you are looking for a ...
Why is this GoodFor one you are writing less code which is (lesswork) awesome, two you are using code that thedev team has...
Learn WordPress Coding         Standards• http://codex.WordPress.org/  WordPress_Coding_Standards• This will make it much ...
Use inline-documantation• awesome for the next guy, or you in a year  after you last looked at the code.• http://codex.Wor...
Questions?
<?php echo “The End”; ?>     Christopher Redinghttp://christopherreding.com      twitter: @creding
Upcoming SlideShare
Loading in …5
×

&lt;?php + WordPress

1,564 views

Published on

Presentation covering what PHP is, the benefits, and some basic best practices relating to WordPress Development. Presented to the Birmingham, Alabama WordPress Meetup May 23rd, 2011 at Pale Eddies Pour House Check out http://wpbham.com for more information about past and future presentations/meetups

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

No Downloads
Views
Total views
1,564
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
6
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • &lt;?php + WordPress

    1. 1. <?php + WordPress Christopher Reding http://christopherreding.com twitter: @creding
    2. 2. What is PHP• PHP ( Hypertext Pre-processor ) is a server side scripting language. Server side means it runs on the server prior to sending data to the browser. Due to this fact you can not run PHP on the page itself.
    3. 3. What can I do With PHP• conditional statements ( if this do that )• create html for the browser• retrieve data from a database• simple and complex math• date manipulation• image creation, ( think captcha )• image manipulation ( think the thumbnails wp creates )• handling file uploads• managing files and directories on the server• read and write cookies• read and write session data ( server cookies sorta )• remote file requests ( like grabbing an rss feed )• parsing xml ( outputting the rss feed )• string manipulation ( capitalize first letter, replace a word, etc.)• create arrays ( like a mini database )• and on and on and on
    4. 4. Common PHP in WordPress• conditional statements - <?php if ( have_posts() ):• loops - <?php while ( have_posts() ): the_post();• WP Classes - <?php $query = new WP_Query($args);• WP Functions - <? the_content(); ?>• WP filters and actions to alter the default WordPress behavior or add to it.• creating your own functions and classes for themes and plugins• date creation and manipulation• adding, removing, or replacing text in a string ( hyperlinks from email addresses )• string shortening ( the excerpt )
    5. 5. Places to learn about PHP?• http://codex.WordPress.org/Function_Reference• http://www.php.net• http://www.w3schools.com/php/• http://net.tutsplus.com/category/tutorials/php/• http://www.sitepoint.com/forums/php-34/• http://www.lynda.com/PHP-training-tutorials/282-0.html
    6. 6. Solving Problems• http://stackoverflow.com/questions/tagged/php• http://google.comThe best source for finding the answer to a problem is always to find aperson who had a similar problem. Word your google searches with this inmind and learn what sites provide the best user generated information( and ranking of answers ) this is one reason I love stackoverflow, theanswers are voted on with the higher number generally being the bestoverall ( not always though )Exploring the WordPress source codeIf you need to accomplish something in WordPress and you don’t have aclue how to do it, you may want to dig into the source to see if the WPdevs have already built your solution.
    7. 7. Tools for the source • http://core.trac.WordPress.org/browser • http://wpseek.comexample: say you are looking for a method to openand read a remote file. You search the source for“open remote file” at wpseek.com this will out puta list of functions and actions/hooks that maymatch your search. If nothing is returned don’t giveup, rather change the query for any other wordsthat describe the functionality you are looking for.
    8. 8. Why is this GoodFor one you are writing less code which is (lesswork) awesome, two you are using code that thedev team has already vetted which saves youfrom trying to make your square peg fit in a WPshaped hole.
    9. 9. Learn WordPress Coding Standards• http://codex.WordPress.org/ WordPress_Coding_Standards• This will make it much easier to read.
    10. 10. Use inline-documantation• awesome for the next guy, or you in a year after you last looked at the code.• http://codex.WordPress.org/ Inline_Documentation
    11. 11. Questions?
    12. 12. <?php echo “The End”; ?> Christopher Redinghttp://christopherreding.com twitter: @creding

    ×