Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 113 114 115 116 117 ... 147
Like python's os.listdir
1 1016 posted 15 years ago by iloveitaly
0 471 posted 15 years ago by iloveitaly
This is a great way to save complex objects as cookie values. You can't just json_encode because commas are not legal in cookie values. Remember not to use this for anything too big because cookies have a 4KB limit.
1 717 posted 15 years ago by segdeha
1 648 posted 15 years ago by nico65
Adds two "sidebars" to the header. You can drag and drop widgets into them just like any other sidebar from your WP dashboard. You can change the Hook to move the "sidebars" somewhere else on the page. For example, change 'thesis_hook_header' to '...
4 1915 posted 15 years ago by fouroclockproject
2 959 posted 15 years ago by Thresh
0 759 posted 15 years ago by sinecera
Completely changed original function, which stopped working around WP2.8.
1 815 posted 15 years ago by kristarella
There's another snippet on here that always comes up on google for finding the relative path to the root, but it doesn't work very well. This version will work from the root, from any subdirectory, and with malformed path names such as www.example.co...
3 1211 posted 15 years ago by blackhole12
This little bit of code is a calculator of the "golden mean" of a given length of time. For example: given a length of 1 minute and 0 seconds, the answer given will be 0:00:37. See U2's "With or Without You", the Greek Parthenon, the human body, etc....
1 1077 posted 15 years ago by rossuber
3 915 posted 15 years ago by cshaiku
3 805 posted 15 years ago by cshaiku
2 953 posted 15 years ago by cshaiku
0 678 posted 15 years ago by martin_rusev
0 594 posted 15 years ago by nico65
All you need to do when writing the post, is enter a custom field with the key "expiration" and set the value in the format: "2010/01/01 18:20:00" - this would expire the post at 6.20pm on the 1st January 2010.
1 747 posted 15 years ago by gjindancer
I pieced together this code when I had to do this for a client: - show the first image attached to a post (based on sort order in gallery tab) in medium size - put all the other images attached to the post into an imageset so that when you click on...
1 1027 posted 15 years ago by zartgesotten
This will output the resulting meta value (notice the addition of "echo"):
1 758 posted 15 years ago by rickfu
1 ... 113 114 115 116 117 ... 147