Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged wordpress



1 ... 8 9 10 11 12 ... 42
Use WP_Query to query a custom taxonomy, using the tax_query parameter.
1 1459 posted 14 years ago by f6design
In Wordpress if you are using a custom taxonomy you can get its details (id, slug, etc) using this snippet.
0 1441 posted 14 years ago by f6design
Add this snippet to your Wordpress theme's functions.php file to reject any image uploads that are below the specified dimensions.
2 1952 posted 14 years ago by f6design
Put the following outside WP
1 1371 posted 14 years ago by stephcode
This snippet adds support for post thumbnails (a.k.a. 'featured images') to a Wordpress theme. It also adds an additional image size for image thumbnails, hard cropped. This second step is optional. Add this snippet to your WP theme's functions.ph...
1 1689 posted 14 years ago by f6design
Add the following to your Wordpress theme's functions.php file. The jQuery paths/URLs might need to be changed to suite your circumstances.
0 2013 posted 14 years ago by f6design
Simplify the Wordpress admin area for clients by hiding menu items. Add this snippet to your Wordpress theme's functions.php file.
0 1744 posted 14 years ago by f6design
If you are creating a custom post type in Wordpress, and turn off the 'editor' capability, then TinyMCE is not loaded. This means any WYSIWYG meta box textareas will fail. Add this snippet to your theme's functions.php file to load the required TinyM...
0 1389 posted 14 years ago by f6design
Add this to your Wordpress theme's functions.php file. It allows you to move the 'featured image' upload/select box from the admin sidebar to another position on the page, to give it more prominence.
0 1610 posted 14 years ago by f6design
I've yet to work on a WordPress site where at least once post wasn't copied from Microsoft Word, producing a mess of inline tags and awful markup. This helps prevent that, just a little.
0 1190 posted 14 years ago by travishines
Custom post page name
0 2334 posted 14 years ago by hernanvionnet
0 1103 posted 14 years ago by xcsteve99
Send an email to all registered users when a post is published, for wordpress 3.1+
0 1419 posted 14 years ago by eniris
Add this to your functions.php file
0 1533 posted 14 years ago by xcsteve99
Just pop this in your IMG tags
2 2525 posted 14 years ago by xcsteve99
OH MY GOD - ok so this solved a few problems... use this instead of just <body> and you have all the tags you could ever want for applying your css.
0 966 posted 14 years ago by randycaruso
If you would like to insert a cForms form into your WordPress website without using the TinyMCE or Widget function, you can do so by inserting this code in your template. Replace ‘Default’ with the name given to your form.
0 2753 posted 14 years ago by albertpak98
A custom breadcrumb function for WordPress that I created for a client. You can pass 2 arguments, the first being the text you want to display in front of the breadcrumb and the second is to hide the home item in the breadcrumb It will give eac...
1 1332 posted 14 years ago by krike
created by Adi Dragus
0 975 posted 14 years ago by innerstorm
Returns Wordpress categories as a hierarchical object (i.e. categories with subcategories)
0 994 posted 14 years ago by adamturtle
The admin pages listing the site’s posts and pages come with various text columns (title, tags, categories, author and so on). In order to see what the featured images are, you have to visit each post or page individually. What I will show here, is...
0 1537 posted 14 years ago by i-am-andy
Only show content if Custom Field exists
0 1622 posted 14 years ago by i-am-andy
Add or Change Content in the Featured Image Meta Box Posted on March 21, 2011 Perhaps you need to provide a little extra instruction about the Featured Image meta box. It doesn’t take much to add your own text to that box:
0 1600 posted 14 years ago by i-am-andy
Link to the current theme / template url for use in wordpress template.
0 1491 posted 14 years ago by carouselcreative
Just insert any category id into the argument and it will return the top level category object. e.g: print_r( get_top_level_category('INSERT CATEGORY ID HERE') );
0 1815 posted 14 years ago by djmosc
1 ... 8 9 10 11 12 ... 42