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 943 posted 11 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 695 posted 11 years ago by adambundy
Take control of HTTP header status codes.
1 819 posted 11 years ago by o0110o
display an image field in the body/page of a custom post type
0 631 posted 11 years ago by mktimes5
Works, even if a locale is not avaliable on the system.
0 664 posted 11 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 734 posted 11 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 730 posted 11 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 595 posted 11 years ago by o0110o
Point the script to an image and get its dominant color.
1 1096 posted 11 years ago by o0110o
Add this to functions.php and then you can call the focus keyword anywhere you want with: <?php wpseoFocusKW();?>
0 837 posted 11 years ago by itsmrchris
Add to functions.php. Replace IDs (64, 104 below) with categories you want to exclude.
1 731 posted 11 years ago by adambundy
How to insert the less preprocessor script in WordPress Websites and Blogs
0 674 posted 11 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 533 posted 11 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 417 posted 11 years ago by martijnhoogwerf
this method generates and returns a unique slug, given a string.
1 750 posted 11 years ago by artaserse
Simple method to insert data to sql
0 491 posted 11 years ago by BergBenji
Update current field data.
0 627 posted 11 years ago by tucq88
This function will compress any text-based content.
1 600 posted 11 years ago by o0110o
Get the text in between more text in a string. Accepts $content,$start,$end & $is_string as parameters.
1 665 posted 11 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 663 posted 11 years ago by FatFolderDesigner
Get the absolute webroot URL.
1 778 posted 11 years ago by o0110o
This function will force a file to be downloaded. It accepts $_path as a parameter.
1 764 posted 11 years ago by o0110o
This function performs several checks to make sure it's getting the correct IP address.
1 1000 posted 11 years ago by o0110o
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
1 906 posted 11 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 1049 posted 11 years ago by o0110o
A function to get a files size via curl. Accepts $_path, $_unit, $_float, $_username & $_password; In the listed order.
1 1052 posted 11 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 1277 posted 11 years ago by o0110o
Here is a function that read the number of times a url is shared on twitter.
1 844 posted 11 years ago by ginoplusio
This allows you to change the logo, title text, and url for the login logo in wordpress.
1 803 posted 11 years ago by bitsculptor
This gives the code for creating a custom post type with all the necessary labels and even custom message support, and it gives the code for a custom taxonomy with that post type.
0 799 posted 11 years ago by bitsculptor
1 ... 14 15 16 17 18 ... 147