Post on 17-May-2015
description
WP HacksWP HacksWhen a “Hacker” Becomes a HeroWhen a “Hacker” Becomes a Hero
by Mohamad Agus Sya’ban
Seri Menjadi Pujangga Wordpress Bagian 3Seri Menjadi Pujangga Wordpress Bagian 3
Wordpress EnrichmentWordpress Enrichment
WP Themes
WP Plugins
WP Hacks
http://ericstoller.com/
Grand TheoryGrand Theory
Hacking (English verb to hack,
Singular noun a hack) refers to
the re-configuring or
re-programming of a system to
function in ways not facilitated
by the owner, administrator, or
designer. http://en.wikipedia.org/wiki/Hack_%28technology%29
http://sxc.hu
WTH is WP-Hacks?WTH is WP-Hacks?
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!
WP-HacksWP-Hacks
In very early versions of WordPress, the only way to modify
the behavior of WordPress was through a "hack", i.e. by
modifying the core files of WordPress.
http://www.blogohblog.com
Note:Since at least version 2.8, my-hacks.php file is not supported any longer.
How can I do the hacks?How can I do the hacks?
• Modifying the wordpress’ core files
• Using function reference (http://codex.wordpress.org/Function_Reference)
• Adding scripts made by wordpress developers into functions.php file
http://oldblog.1choice4yourstore.com/
DemoDemo
No photos = hoax
in this case:
So, let’s get it on!
No demos = hoax!
Demo 1: Demo 1: Modifying The Wordpress’ Core Files
How to change some html codes on my search form?
It’s just a piece of cake!
If you don't have searchform.php in your
Theme, WordPress will render its built-in
search form. If you do have it in your
Theme, it will be used instead.
Demo 2: Demo 2: Using Function Reference
How to show some certain elements only if any single post being displayed?
Simply put this conditional tag right before stuff you want to show:
is_single(); // When any single Post page is being displayed.
is_single('17'); // When Post 17 (ID) is being displayed.
is_single('Irish Stew'); // When the Post with post_title of "Irish Stew" is being
displayed.
is_single('beef-stew'); // When the Post with post_name (slug) of "beef-stew" is
being displayed.
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 "beef-stew", or the post_title is "Irish Stew".
Demo 3 Demo 3 Using functions.phpUsing functions.php
How to show my latest tweets without using plugins?
Paste the below in your functions.php file:
function wp_echoTwitter($username){ include_once(ABSPATH.WPINC.'/rss.php'); $tweet = fetch_rss("http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1"); echo $tweet->items[0]['atom_content']; }
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/
Hacks are not officially supported by
WordPress. Use at your own risk.