Welcome To Snipplr
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
I\'ve added an additional case to handle videos linked from a user\'s channel.
2
1206
posted 14 years ago by Jamie
This code adds the specified library to the header in WordPress unless you are in the admin section.
2
770
posted 14 years ago by jonkemp
By default, this template will use the page title as the category to pull from – but you can also create a custom field with ‘category’ as the name and the preferred category name as the value.
1
737
posted 14 years ago by trepmal
Just a quick fix for a tag link issue I came across.\r\n\r\nbroken url:\r\ndomain.com/tag/two word.html\r\n\r\nif you take the spaces in the URL and replace them with pluses (‘+’) it’ll work. For example:\r\n\r\nfixed url:\r\ndomain.com/tag/two...
0
674
posted 14 years ago by trepmal
I don't recommend this, it just needed it for a particular situation. Does not work with dropdowns.
0
779
posted 14 years ago by trepmal
This example shows how to delete specific files after a given time span.
This works good for cleaning cached files.
1
767
posted 14 years ago by fackz
Geo Mashup contextual maps display the results of a WordPress query, so they can be very useful in combination with the WordPress `query_posts` function. This example maps post with an example tag, but any call to `query_posts` could be substituted....
0
839
posted 14 years ago by cyberhobo
I used this plugin to create new roles/capabilities: http://wordpress.org/extend/plugins/capsman/
1
544
posted 14 years ago by seafae
When retrieving table rows with PHP and prepared statements, you must use a method called bind_result() and pass in a variable name for each column that is being returned from the database. For example, if you are selecting three columns (say, id, ti...
3
1193
posted 14 years ago by Nettuts
The current time, converted from UNIX timestamp to use in MySQL DATETIME
0
998
posted 14 years ago by koko
I needed to create several pages that didn't use any models and contained static data inside the default layout. My first thought was to create a controller for these pages and define an action for each static page I needed. However, this solution se...
0
655
posted 14 years ago by TioSolid
run as callback from form_validation->setrules
ex:
$this->form_validation->set_rules('cc_number','Credit Card #','required|max_length[20]|callback_alpha_dash_space');
0
792
posted 14 years ago by myke