Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 14 15 16 17 18 ... 147
AL subir imagen png, se deben pasar al directorio con transparencia
0 1426 posted 12 years ago by thescorpion
Thanks to @kaiser on WP answers for this. Place this function in your functions.php file, then use it in your template with the function call like: wpse19316_author_comments( 100 );
1 1286 posted 12 years ago by adambundy
Take control of HTTP header status codes.
1 1347 posted 12 years ago by o0110o
display an image field in the body/page of a custom post type
0 1127 posted 12 years ago by mktimes5
Does not work at the moment. So don't copy it.
0 866 posted 12 years ago by eridesigns
Works, even if a locale is not avaliable on the system.
0 1154 posted 12 years ago by chatelao
Want to be able to display the source code of any webpage, with line numbering? Here is a simple code snippet to do it. Just modify the url on line 2 at your convenience. Or even better, make a pretty function according to your needs.
2 1273 posted 12 years ago by o0110o
If you need to get the whois information for a specific domain, why not using PHP to do it? The following function take a domain name as a parameter, and then display the whois info related to the domain.
1 1230 posted 12 years ago by o0110o
In order to optimize your scripts, you may definitely want to know how many amount of RAM they use on your server. This snippet will check memory and then print initial, final and peak usages.
3 1054 posted 12 years ago by o0110o
Point the script to an image and get its dominant color.
1 1721 posted 12 years ago by o0110o
Add this to functions.php and then you can call the focus keyword anywhere you want with: <?php wpseoFocusKW();?>
0 1405 posted 12 years ago by itsmrchris
Add to functions.php. Replace IDs (64, 104 below) with categories you want to exclude.
1 1258 posted 12 years ago by adambundy
How to insert the less preprocessor script in WordPress Websites and Blogs
0 1160 posted 12 years ago by ecksteing
In this example it checks to see if the page it is on has an ACF named page_title, if so - display it as an H1, and if not, display the WP default page title as the H1
0 988 posted 12 years ago by itsmrchris
If you are a PHP developer, you are probably aware that you can pass an array of strings as the search strings and an array as the replacements to the str_replace function. In this example you can see how to automatically replace smiley shortcuts by...
1 800 posted 12 years ago by martijnhoogwerf
this method generates and returns a unique slug, given a string.
1 1250 posted 12 years ago by artaserse
Simple method to insert data to sql
0 913 posted 12 years ago by BergBenji
Update current field data.
0 1141 posted 12 years ago by tucq88
This function will compress any text-based content.
1 1038 posted 12 years ago by o0110o
Get the text in between more text in a string. Accepts $content,$start,$end & $is_string as parameters.
1 1170 posted 12 years ago by o0110o
It's a 3 part process, first is the PHP that you need to run, which includes the appropriate scripts and styles into the admin header, then you need an html button and input field to put the stored value in, then you need some jQuery to open the popu...
0 1172 posted 12 years ago by FatFolderDesigner
Get the absolute webroot URL.
1 1526 posted 12 years ago by o0110o
This function will force a file to be downloaded. It accepts $_path as a parameter.
1 1492 posted 12 years ago by o0110o
This function performs several checks to make sure it's getting the correct IP address.
1 1816 posted 12 years ago by o0110o
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
1 1689 posted 12 years ago by o0110o
This function will use curl to see if a file exists at the location it's provided. It accepts $_path as a parameter.
1 1882 posted 12 years ago by o0110o
A function to get a files size via curl. Accepts $_path, $_unit, $_float, $_username & $_password; In the listed order.
1 1887 posted 12 years ago by o0110o
This is a function to retrieve the mime-type of a file by checking the header response with curl. It accepts the file-path as a parameter & it also has a fallback for empty returns.
1 2346 posted 12 years ago by o0110o
Here is a function that read the number of times a url is shared on twitter.
1 1366 posted 12 years ago by ginoplusio
This allows you to change the logo, title text, and url for the login logo in wordpress.
1 1293 posted 12 years ago by bitsculptor
1 ... 14 15 16 17 18 ... 147