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 1009 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 750 posted 11 years ago by adambundy
Take control of HTTP header status codes.
1 858 posted 11 years ago by o0110o
display an image field in the body/page of a custom post type
0 670 posted 11 years ago by mktimes5
Works, even if a locale is not avaliable on the system.
0 698 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 777 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 784 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 622 posted 11 years ago by o0110o
Point the script to an image and get its dominant color.
1 1155 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 868 posted 11 years ago by itsmrchris
Add to functions.php. Replace IDs (64, 104 below) with categories you want to exclude.
1 787 posted 11 years ago by adambundy
How to insert the less preprocessor script in WordPress Websites and Blogs
0 707 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 561 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 446 posted 11 years ago by martijnhoogwerf
this method generates and returns a unique slug, given a string.
1 782 posted 11 years ago by artaserse
Simple method to insert data to sql
0 529 posted 11 years ago by BergBenji
Update current field data.
0 661 posted 11 years ago by tucq88
This function will compress any text-based content.
1 627 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 694 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 703 posted 11 years ago by FatFolderDesigner
Get the absolute webroot URL.
1 820 posted 11 years ago by o0110o
This function will force a file to be downloaded. It accepts $_path as a parameter.
1 809 posted 11 years ago by o0110o
This function performs several checks to make sure it's getting the correct IP address.
1 1048 posted 11 years ago by o0110o
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
1 954 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 1107 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 1120 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 1345 posted 11 years ago by o0110o
Here is a function that read the number of times a url is shared on twitter.
1 885 posted 11 years ago by ginoplusio
This allows you to change the logo, title text, and url for the login logo in wordpress.
1 860 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 860 posted 11 years ago by bitsculptor
1 ... 14 15 16 17 18 ... 147