WP Hacks When a “Hacker” Becomes a Hero by Mohamad Agus Sya’ban Seri Menjadi Pujangga Wordpress Bagian 3
Wordpress Enrichment <ul><li>WP Themes </li></ul><ul><li>WP Plugins </li></ul><ul><li>WP Hacks </li></ul>http://ericstolle...
Grand Theory <ul><li>Hacking  (English verb  to hack ,  </li></ul><ul><li>Singular noun  a hack ) refers to </li></ul><ul>...
WTH is WP-Hacks? <ul><li>If you need to build a  </li></ul><ul><li>wordpress site which  </li></ul><ul><li>does not only h...
WP-Hacks <ul><li>In very early versions of WordPress, the only way to modify </li></ul><ul><li>the behavior of WordPress w...
How can I do the hacks? <ul><li>Modifying the wordpress’ core files </li></ul><ul><li>Using function reference  </li></ul>...
Demo <ul><li>No photos = hoax </li></ul><ul><li>in this case:  </li></ul><ul><li>So, let’s get it on! </li></ul>No demos =...
Demo 1:  Modifying The Wordpress’ Core Files How to change some html codes on my search form?
<ul><li>It’s just a piece of cake! </li></ul><ul><li>If you don't have  searchform.php  in your  </li></ul><ul><li>Theme, ...
Demo 2:  Using Function Reference How to show some certain elements only if any single post being displayed?
<ul><li>Simply put this conditional tag right before stuff you want to show: </li></ul><ul><li>is_single();  </li></ul><ul...
Demo 3  Using functions.php How to show my latest tweets without using plugins?
<ul><li>Paste the below in your  functions.php  file:  </li></ul><ul><li>function wp_echoTwitter($username){ include_once(...
Now just paste the following in your theme file where you want your Twitter post to appear:  <?php wp_echoTwitter(‘abanest...
 
<ul><li>Hacks are not officially supported by </li></ul><ul><li>WordPress. Use at your own risk.   </li></ul>
 
Upcoming SlideShare
Loading in …5
×

Wordpress Hacks: When a "Hacker" Becomes a Hero

876 views
839 views

Published on

If you need to build a wordpress site which
does not only have a default setting for both looks or functionality, then WP-Hacks is the answer!

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

  • Be the first to like this

No Downloads
Views
Total views
876
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Wordpress Hacks: When a "Hacker" Becomes a Hero

  1. 1. WP Hacks When a “Hacker” Becomes a Hero by Mohamad Agus Sya’ban Seri Menjadi Pujangga Wordpress Bagian 3
  2. 2. Wordpress Enrichment <ul><li>WP Themes </li></ul><ul><li>WP Plugins </li></ul><ul><li>WP Hacks </li></ul>http://ericstoller.com/
  3. 3. Grand Theory <ul><li>Hacking (English verb to hack , </li></ul><ul><li>Singular noun a hack ) refers to </li></ul><ul><li>the re-configuring or </li></ul><ul><li>re-programming of a system to </li></ul><ul><li>function in ways not facilitated </li></ul><ul><li>by the owner, administrator, or </li></ul><ul><li>designer. </li></ul><ul><li>http://en.wikipedia.org/wiki/Hack_%28technology%29 </li></ul>http://sxc.hu
  4. 4. WTH is WP-Hacks? <ul><li>If you need to build a </li></ul><ul><li>wordpress site which </li></ul><ul><li>does not only have a </li></ul><ul><li>default setting for both </li></ul><ul><li>looks or functionality , </li></ul><ul><li>then WP-Hacks is the </li></ul><ul><li>answer! </li></ul>
  5. 5. WP-Hacks <ul><li>In very early versions of WordPress, the only way to modify </li></ul><ul><li>the behavior of WordPress was through a &quot;hack&quot;, i.e. by </li></ul><ul><li>modifying the core files of WordPress. </li></ul>http://www.blogohblog.com Note: Since at least version 2.8, my-hacks.php file is not supported any longer.
  6. 6. How can I do the hacks? <ul><li>Modifying the wordpress’ core files </li></ul><ul><li>Using function reference </li></ul><ul><li>(http://codex.wordpress.org/Function_Reference) </li></ul><ul><li>Adding scripts made by wordpress developers into functions.php file </li></ul>http://oldblog.1choice4yourstore.com/
  7. 7. Demo <ul><li>No photos = hoax </li></ul><ul><li>in this case: </li></ul><ul><li>So, let’s get it on! </li></ul>No demos = hoax!
  8. 8. Demo 1: Modifying The Wordpress’ Core Files How to change some html codes on my search form?
  9. 9. <ul><li>It’s just a piece of cake! </li></ul><ul><li>If you don't have searchform.php in your </li></ul><ul><li>Theme, WordPress will render its built-in </li></ul><ul><li>search form. If you do have it in your </li></ul><ul><li>Theme, it will be used instead. </li></ul>
  10. 10. Demo 2: Using Function Reference How to show some certain elements only if any single post being displayed?
  11. 11. <ul><li>Simply put this conditional tag right before stuff you want to show: </li></ul><ul><li>is_single(); </li></ul><ul><li>// When any single Post page is being displayed. </li></ul><ul><li>is_single('17'); </li></ul><ul><li>// When Post 17 (ID) is being displayed. </li></ul><ul><li>is_single('Irish Stew'); </li></ul><ul><li>// When the Post with post_title of &quot;Irish Stew&quot; is being displayed. </li></ul><ul><li>is_single('beef-stew'); </li></ul><ul><li>// When the Post with post_name (slug) of &quot;beef-stew&quot; is being displayed. </li></ul><ul><li>is_single(array(17,'beef-stew','Irish Stew')); // Returns true when the single post being displayed is either post ID 17, or the post_name is &quot;beef-stew&quot;, or the post_title is &quot;Irish Stew&quot;. </li></ul>
  12. 12. Demo 3 Using functions.php How to show my latest tweets without using plugins?
  13. 13. <ul><li>Paste the below in your functions.php file: </li></ul><ul><li>function wp_echoTwitter($username){ include_once(ABSPATH.WPINC.'/rss.php'); $tweet = fetch_rss(&quot;http://search.twitter.com/search.atom?q=from:&quot; . $username . &quot;&rpp=1&quot;); echo $tweet->items[0]['atom_content']; } </li></ul>
  14. 14. Now just paste the following in your theme file where you want your Twitter post to appear: <?php wp_echoTwitter(‘abanesta’); ?> Obviously replace my username with yours. Now you’re done! Style it however you like with HTML and CSS. http://www.johnkolbert.com/wordpress/show-your-latest-tweet-in-5-lines-of-code/
  15. 16. <ul><li>Hacks are not officially supported by </li></ul><ul><li>WordPress. Use at your own risk. </li></ul>

×