Welcome To Snipplr
Everyone's Recent PHP Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
AL subir imagen png, se deben pasar al directorio con transparencia
0
1152
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
907
posted 12 years ago by adambundy
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
938
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
919
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
770
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
1031
posted 12 years ago by itsmrchris
Add to functions.php. Replace IDs (64, 104 below) with categories you want to exclude.
1
935
posted 12 years ago by adambundy
How to insert the less preprocessor script in WordPress Websites and Blogs
0
851
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
697
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
568
posted 12 years ago by martijnhoogwerf
this method generates and returns a unique slug, given a string.
1
931
posted 12 years ago by artaserse
Get the text in between more text in a string. Accepts $content,$start,$end & $is_string as parameters.
1
854
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
845
posted 12 years ago by FatFolderDesigner
This function will force a file to be downloaded. It accepts $_path as a parameter.
1
985
posted 12 years ago by o0110o
This function performs several checks to make sure it's getting the correct IP address.
1
1219
posted 12 years ago by o0110o
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
1
1128
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
1311
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
1295
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
1633
posted 12 years ago by o0110o
Here is a function that read the number of times a url is shared on twitter.
1
1035
posted 12 years ago by ginoplusio
This allows you to change the logo, title text, and url for the login logo in wordpress.
1
1003
posted 12 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
1031
posted 12 years ago by bitsculptor