Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged c



1 ... 34 35 36 37 38 ... 147
0 861 posted 14 years ago by isodinner
Add code to theme functions.php file.
0 1716 posted 14 years ago by Huskie
0 1568 posted 14 years ago by iloveitaly
Usage: <?php>post_excerpt; if($textin == ""){ $textin = $post->post_content; } echo TruncateText($textin, 150); ?>
0 1186 posted 14 years ago by tcelestino
Comes in handy for php magic functions such as __get and __set. This behaviour is fixed in php 5.3. Returns true also for private and protected properties using a reflectionclass
0 1543 posted 14 years ago by Roen
Get posts from a Custom Post Type
0 3619 posted 14 years ago by i-am-andy
Useful snippet for getting a specific number of posts from a specific category, useful for news listing in sidebar
0 1311 posted 14 years ago by i-am-andy
declare all custom fields first
0 1219 posted 14 years ago by mesh606
Thanks to followgram.me you can read a public feed with your photos. Use this code to retrieve your Instagr.am photos and use them on your web.
0 1882 posted 14 years ago by ginoplusio
Questa piccola funzione riceve come argomento uno unix timestamp e ritorna una stringa contenente la "descrizione verbosa" della differenza di tempo. Ad esempio, usando il timestamp relativo a 5 minuti e mezzo fa, ritornerà la stringa "5 minuti e 30...
0 1153 posted 14 years ago by claudiowebdesign
Useful when using user-submitted URLs
0 1172 posted 14 years ago by Entherman
I was working on a site that pulled in and republished a bunch of RSS feeds. Some contained duff images such as blank gifs that I needed to block so I wrote this function to compare the url of an image against a blacklist
0 1720 posted 14 years ago by paulo72
Instead of requiring the loop.php file in your custom themes you can use there two functions, placed in your functions.php file to not only automatically include it, but make a dead simple to filter sections out on a page by page basis negating the n...
0 1358 posted 14 years ago by FatFolderDesigner
if don't like `@import` in stylesheet
0 1081 posted 14 years ago by hasssan
0 1468 posted 14 years ago by kbrown
1 1262 posted 14 years ago by rahijain
0 1204 posted 14 years ago by rahijain
0 1103 posted 14 years ago by lucaborace
0 1207 posted 14 years ago by tcelestino
0 1735 posted 14 years ago by stur
0 1078 posted 14 years ago by stur
0 1280 posted 14 years ago by mafhh14
1 ... 34 35 36 37 38 ... 147