Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged wordpress



1 ... 4 5 6 7 8 ... 43
I needed away to redirect to a custom BP component upon login for users and this works great. Add this to your functions file. If you are the admin, it will redirect you to the wp-admin.
0 12665 posted 11 years ago by dnnsldr
Add this to functions.php to enable the page-child function is_tree
0 445 posted 11 years ago by klagraff
This function, when placed in a theme's 'functions.php' file will insert a custom id attribute into the '<li>' elements generated by a 'wp_nav_menu' function based on the title of the element. It will make a WordPress page or category into a hyphen s...
0 876 posted 11 years ago by SFLWebDev
Function to get wordpress post/page slug to be used on for custom class etc
0 765 posted 11 years ago by Farhan
Adds an excerpt field to pages when editing. Goes in functions.php
1 620 posted 11 years ago by klagraff
Insert this in functions.php to remove WordPress version from being output in the header source code
0 663 posted 11 years ago by klagraff
A regular expression for removing <br> and <br> (case insensitive) between HTML elements if there is no content between the HTML elements. It was written for fixing extra line spaces created in a WordPress visual editor after the content of the visu...
0 601 posted 11 years ago by pumpkinthehead
Useful for adding Custom Post types to navigation this will list all custom post type posts
1 712 posted 11 years ago by i-am-andy
I need this function all too often and figured I'd share it. Limit the_content() by word limit by using built in WordPress functions.
0 792 posted 11 years ago by crypticsoft
this is an easy function to add a gravitar to wordpress.
0 515 posted 11 years ago by bitsculptor
Here is a quick example on how to generate your own portfolio with filtering based on a taxonomy (in this case 'Solutions').
0 842 posted 11 years ago by crypticsoft
A little function to add custom styles to the tinymce editor in wordpress.
1 653 posted 11 years ago by bitsculptor
wp template naming
0 654 posted 11 years ago by thesmu
http://www.binarymoon.co.uk/2009/10/timthumb-wordpress-mu/
0 550 posted 11 years ago by rabc
Template For Wordpress widgets.
0 657 posted 11 years ago by paullombard
To be used in the header.php
0 609 posted 11 years ago by certainlyakey
For more parameters: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
0 506 posted 11 years ago by thescottlee
- Use custom image size within template (including if exist) - Add a class name to a custom image size
0 760 posted 11 years ago by thescottlee
Note: This also uses a flat file to cache the results, be sure to also upload the 'rss_cache.txt' file. Usage: <?php>
0 848 posted 11 years ago by crypticsoft
A function to query the 10 most recent posts on a multisite WordPress installation
0 1576 posted 11 years ago by chasecrawford
0 735 posted 11 years ago by shufflepath
If contents is "page-name" do stuff
1 458 posted 11 years ago by akmuraro
Add this snippet to the functions.php to add 'Donate' Button on your Wordpress Website.
0 733 posted 11 years ago by planetabhi
Add this snippet to the functions.php to render your twitter followers count. Replace 'planetabhi' with your twitter screen name
0 813 posted 11 years ago by planetabhi
Add this snippet to the functions.php of your wordpress theme. This will add a select menu with an automatically generated list of your shortcodes for your pages and posts.
1 542 posted 11 years ago by planetabhi
Just paste the following snippet into your functions.php file and save it.
0 685 posted 11 years ago by planetabhi
For when you really just need a short description field along with a title for your slideshows. Just drop this into the functions.php and meteor-slideshow.php in the theme folder.
0 942 posted 11 years ago by crypticsoft
Here is a simple filter to automatically add a class attribute like widget-order-1 to all widgets within sidebars (from konstruktors.com)
0 767 posted 11 years ago by lashon
Takes titles from a certain category and lists them in an unordered list.
0 612 posted 11 years ago by thewickedchemist
1 ... 4 5 6 7 8 ... 43