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 1253 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 1048 posted 12 years ago by adambundy
Take control of HTTP header status codes.
1 1113 posted 12 years ago by o0110o
display an image field in the body/page of a custom post type
0 918 posted 12 years ago by mktimes5
Does not work at the moment. So don't copy it.
0 491 posted 12 years ago by eridesigns
Works, even if a locale is not avaliable on the system.
0 963 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 1041 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 1037 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 858 posted 12 years ago by o0110o
Point the script to an image and get its dominant color.
1 1465 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 1182 posted 12 years ago by itsmrchris
Add to functions.php. Replace IDs (64, 104 below) with categories you want to exclude.
1 1044 posted 12 years ago by adambundy
How to insert the less preprocessor script in WordPress Websites and Blogs
0 929 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 797 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 646 posted 12 years ago by martijnhoogwerf
this method generates and returns a unique slug, given a string.
1 1042 posted 12 years ago by artaserse
Simple method to insert data to sql
0 745 posted 12 years ago by BergBenji
Update current field data.
0 932 posted 12 years ago by tucq88
This function will compress any text-based content.
1 837 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 944 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 948 posted 12 years ago by FatFolderDesigner
Get the absolute webroot URL.
1 1109 posted 12 years ago by o0110o
This function will force a file to be downloaded. It accepts $_path as a parameter.
1 1077 posted 12 years ago by o0110o
This function performs several checks to make sure it's getting the correct IP address.
1 1348 posted 12 years ago by o0110o
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
1 1245 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 1447 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 1423 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 1847 posted 12 years ago by o0110o
Here is a function that read the number of times a url is shared on twitter.
1 1137 posted 12 years ago by ginoplusio
This allows you to change the logo, title text, and url for the login logo in wordpress.
1 1083 posted 12 years ago by bitsculptor
1 ... 14 15 16 17 18 ... 147