Welcome To Snipplr
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Nothing revolutionary, just a simple implementation.
A reworking from Brian Cray's source code:
http://briancray.com/2009/08/21/tweeted-links-twitter-api-php-cache/
Note: requires creating a cache file, '/caches/twitter', relative to source.
0
728
posted 12 years ago by richardmaisano
A simple function that will split a given string into sentences, and then return the number of sentences specified. Quick and dirty.
0
525
posted 12 years ago by adamturtle
Twitter have changed their api, and using the old twitter.com?status=… doesn't work anymore. This uses the new 'Web Intents' method.
0
527
posted 12 years ago by adamturtle
To enablefeatured image on a post, just open your theme’s functions.php file, paste in the code below, and voila!
0
595
posted 12 years ago by xavsio4
By putting the following code in your theme’s functions.php file, you create two extra sizes:
0
504
posted 12 years ago by xavsio4
If you want to be able to use shortcodes in WordPress widgets, place the snippet below into your functions.php, or custom_functions.php file
0
539
posted 12 years ago by codepunk
Tiny script to write a daily logfile with the serverload. Can be run every X minutes using a cron for example.
Result in logfile:
13.40 | 2.45 2.45 2.43
13.45 | 1.62 2.02 2.25
0
592
posted 12 years ago by remko
CodeIgniter Helper function to repopulate form values when a muli-dimensional post array key is used.
0
472
posted 12 years ago by bretticus
Use this to pull a list of items based on the nid of the 'parent' node.... so you can show fields added to that node, on the child. Handy.
Make nid argument..... use custom php arg code below to feed the argument the nid of the parent.
Remember...
0
442
posted 12 years ago by janlodey
Use this on a Term ID argument - enter the below as provide default agrument - php Code
remember to change the vid to your vocabulary
0
492
posted 12 years ago by janlodey
Fügen Sie diesen Codeabschnitt auf allen Seiten die mit der Breadcrumb-Navigation ausgestattet werden sollen, an der gewünschten Position ein.<br><br>
Das Script arbeitet recht einfach:<br><br>
<li>per 'explode("/","$_SERVER[PHP_SELF]")' wird...
0
975
posted 12 years ago by kopfaction