Can WordPressReally Do That?- a case study ofvierderduer.noMorten Rand-Hendriksenmorten@pinkandyellow.com | @mor10 |design...
www.designisphilosophy.comwww.lynda.com/mor10Twitter: @mor10Morten Rand-Hendriksenmorten@pinkandyellow.com | @mor10 |desig...
A little historyand a lesson in Norwegian
= 5 kr ( roughly $1                  )
Oh, and we want the site tosend SMS messages to theapplicants whenever theirapplication has been updated.Can WordPress rea...
A look behind the scenes
Don’t reinvent the wheel
Featuredimage
FeaturedimagePost title
FeaturedimagePost titleTaxonomies
FeaturedimagePost titleTaxonomiesCustom Fields
FeaturedimagePost titleTaxonomiesCustom FieldsBased on Likecount
FeaturedimagePost titleTaxonomiesCustom FieldsBased on LikeBased oncountPublish Date
Dynamic content on single         pages
Custom Post Types:http://codex.wordpress.org/Function_Reference/re                 gister_post_type
Custom Taxonomies:http://codex.wordpress.org/Function_Reference/re                 gister_taxonomy
Set a default taxonomy term
User Generated Posts
The Form Itself
Custom Index Pages for custom post types,   custom taxonomies,    and the front page
WordPress Template Hierarchyhttp://codex.wordpress.org/Template_Hierar                    chy
Custom Index Pages             archive-$post_type.phpCustom Post Types:             taxonomy-$taxonomy-Custom Taxonomies:F...
Custom Queries and Loops
FIRSTLOOP:8 latest newapplicationsSECONDLOOP:4 latest grants
FIRSTLOOP:8 latest newapplicationsSECONDLOOP:4 latest grantsgranted
<?php get_template_part(indexBoxLoop); ?>
<?php include(posttypes); ?>
<?php get_template_part(indexBoxLoop); ?>
Get the term list for an object<?php        echo get_the_term_list(              $post->ID,              $term,           ...
Get the term list for an object<?php        echo get_the_term_list(              $post->ID,              aktivitet,       ...
Get the term list for an object<?php        echo "<ul>";        echo get_the_term_list(              $post->ID,           ...
A Lesson Learned:DON’T TRUST FACEBOOK!
≠ 1 like
= 1 likeor 1 shareor 1commentor 1 clicketc etc etc
Getting Facebook Like (etc)             Numbers    Facebook Query Language (FQL)https://api.facebook.com/method/fql.query?...
Getting Facebook Like (etc)             Numbers    Facebook Query Language (FQL)https://api.facebook.com/method/fql.query?...
Getting Facebook Like (etc)             Numbers    Facebook Query Language (FQL)https://api.facebook.com/method/fql.query?...
Parsing Facebook Like              Numbers<?php$permalink = get_permalink( $post->ID );$content =file_get_contents("https:...
Computers are really good at          math
Finding the percentage for            completion<?php$earned = ($likes*5);?><div class="earned">  Earned: <?php echo $earn...
Finding the percentage for            completion<?php$kroner = ($likes*5);if ($kroner <= 3000) {  $earned = $kroner;} else...
Finding the percentage for            completion<?php$kroner = ($likes*5);if ($kroner <= 3000) {  $earned = $kroner;  $per...
Making the percentage graph.earned {       background-color: #dfe0e0;       position: relative;       height: 8px;       m...
What about this SMS thing?
Anything WordPress can do I              can do too                     In this case<?phpadd_action(publish_soknad, check_...
Bonus 1 Get (and fix) URL from a custom field<?phpif ((get_post_meta($post->ID, website, true))) {  $websiteURL = get_post...
Bonus 2      Automatic oEmbed of videos via<?php               custom fieldif(get_post_meta($post->ID, video, true)) { ?> ...
Questions?come on, you know you got‘em...
www.designisphilosophy.comwww.lynda.com/mor10Twitter: @mor10Morten Rand-Hendriksenmorten@pinkandyellow.com | @mor10 |desig...
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
Upcoming SlideShare
Loading in...5
×

Can WordPress really do that? A case study of vierderduer.no

11,732

Published on

Slides from Morten Rand-Hendriksen's talk Can WordPress really do that? A case study of vierderduer.no at WordCamp Victoria 2012

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

No Downloads
Views
Total Views
11,732
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Can WordPress really do that? A case study of vierderduer.no

  1. 1. Can WordPressReally Do That?- a case study ofvierderduer.noMorten Rand-Hendriksenmorten@pinkandyellow.com | @mor10 |designisphilosophy.com
  2. 2. www.designisphilosophy.comwww.lynda.com/mor10Twitter: @mor10Morten Rand-Hendriksenmorten@pinkandyellow.com | @mor10 |designisphilosophy.com
  3. 3. A little historyand a lesson in Norwegian
  4. 4. = 5 kr ( roughly $1 )
  5. 5. Oh, and we want the site tosend SMS messages to theapplicants whenever theirapplication has been updated.Can WordPress really do that?
  6. 6. A look behind the scenes
  7. 7. Don’t reinvent the wheel
  8. 8. Featuredimage
  9. 9. FeaturedimagePost title
  10. 10. FeaturedimagePost titleTaxonomies
  11. 11. FeaturedimagePost titleTaxonomiesCustom Fields
  12. 12. FeaturedimagePost titleTaxonomiesCustom FieldsBased on Likecount
  13. 13. FeaturedimagePost titleTaxonomiesCustom FieldsBased on LikeBased oncountPublish Date
  14. 14. Dynamic content on single pages
  15. 15. Custom Post Types:http://codex.wordpress.org/Function_Reference/re gister_post_type
  16. 16. Custom Taxonomies:http://codex.wordpress.org/Function_Reference/re gister_taxonomy
  17. 17. Set a default taxonomy term
  18. 18. User Generated Posts
  19. 19. The Form Itself
  20. 20. Custom Index Pages for custom post types, custom taxonomies, and the front page
  21. 21. WordPress Template Hierarchyhttp://codex.wordpress.org/Template_Hierar chy
  22. 22. Custom Index Pages archive-$post_type.phpCustom Post Types: taxonomy-$taxonomy-Custom Taxonomies:Front Page: $term.php front-page.php
  23. 23. Custom Queries and Loops
  24. 24. FIRSTLOOP:8 latest newapplicationsSECONDLOOP:4 latest grants
  25. 25. FIRSTLOOP:8 latest newapplicationsSECONDLOOP:4 latest grantsgranted
  26. 26. <?php get_template_part(indexBoxLoop); ?>
  27. 27. <?php include(posttypes); ?>
  28. 28. <?php get_template_part(indexBoxLoop); ?>
  29. 29. Get the term list for an object<?php echo get_the_term_list( $post->ID, $term, [before list], [between each item], [after list] );?>
  30. 30. Get the term list for an object<?php echo get_the_term_list( $post->ID, aktivitet, , , );?>
  31. 31. Get the term list for an object<?php echo "<ul>"; echo get_the_term_list( $post->ID, aktivitet, <li>, </li><li>, </li> ); echo "</ul>";?>
  32. 32. A Lesson Learned:DON’T TRUST FACEBOOK!
  33. 33. ≠ 1 like
  34. 34. = 1 likeor 1 shareor 1commentor 1 clicketc etc etc
  35. 35. Getting Facebook Like (etc) Numbers Facebook Query Language (FQL)https://api.facebook.com/method/fql.query?query=select%20%20like_count,%20total_count,%20share_count,%20click_count,%20comment_count%20from%20link_stat%20where%20url=http://www.wordcampvictoria.ca/&format=xml
  36. 36. Getting Facebook Like (etc) Numbers Facebook Query Language (FQL)https://api.facebook.com/method/fql.query?query=select%20%20like_count,%20total_count,%20share_count,%20click_count,%20comment_count%20from%20link_stat%20where%20url=http://www.wordcampvictoria.ca/&format=xml
  37. 37. Getting Facebook Like (etc) Numbers Facebook Query Language (FQL)https://api.facebook.com/method/fql.query?query=select%20%20like_count,%20total_count,%20share_count,%20click_count,%20comment_count%20from%20link_stat%20where%20url=http://www.wordcampvictoria.ca/&format=xml
  38. 38. Parsing Facebook Like Numbers<?php$permalink = get_permalink( $post->ID );$content =file_get_contents("https://api.facebook.com/method/fql.query?query=select%20total_count%20from%20link_stat%20where%20url=" . $permalink . "&format=xml");$element = new SimpleXmlElement($content);$likes = $element->link_stat->total_count;echo $likes;?>
  39. 39. Computers are really good at math
  40. 40. Finding the percentage for completion<?php$earned = ($likes*5);?><div class="earned"> Earned: <?php echo $earned; ?>kr</div><!-- .earned -->
  41. 41. Finding the percentage for completion<?php$kroner = ($likes*5);if ($kroner <= 3000) { $earned = $kroner;} else { $earned = 3000;}?><div class="earned"> Earned: <?php echo $earned; ?>kr</div><!-- .earned -->
  42. 42. Finding the percentage for completion<?php$kroner = ($likes*5);if ($kroner <= 3000) { $earned = $kroner; $percent = (($likes*100)/600);} else { $earned = 3000; $percent = 100;}?><div class="earned"> <span style="width: <?php echo $percent; ?>%"> Earned: <?php echo $earned; ?>kr </span></div><!-- .earned -->
  43. 43. Making the percentage graph.earned { background-color: #dfe0e0; position: relative; height: 8px; margin-top: 15px; border-radius: 5px;}.earned span { background-color: #16bcee; position: absolute; height: 8px; text-indent: -9999px; border-radius: 5px;}
  44. 44. What about this SMS thing?
  45. 45. Anything WordPress can do I can do too In this case<?phpadd_action(publish_soknad, check_term_changes, 10, 2);function check_term_changes($post_id, $post){ $terms = wp_get_object_terms($post_id, $taxonomy); switch($term_id) { case $term_id == $status_terms[post_likes]: $sms_message = message; break; update_post_meta($post_id, _prev_status, $term_id);}?>
  46. 46. Bonus 1 Get (and fix) URL from a custom field<?phpif ((get_post_meta($post->ID, website, true))) { $websiteURL = get_post_meta($post->ID, website, true); if (substr($websiteURL,0,7) != http://) { $websiteURL = http:// . $websiteURL; }?><a href="<?php echo $websiteURL ?>“ title="Website"> The Website</a><?php } ?>
  47. 47. Bonus 2 Automatic oEmbed of videos via<?php custom fieldif(get_post_meta($post->ID, video, true)) { ?> <div id="video"> <?php $video = get_post_meta($post->ID, video, true); echo wp_oembed_get( $video ); ?> </div><?php}?>
  48. 48. Questions?come on, you know you got‘em...
  49. 49. www.designisphilosophy.comwww.lynda.com/mor10Twitter: @mor10Morten Rand-Hendriksenmorten@pinkandyellow.com | @mor10 |designisphilosophy.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×