Welcome To Snipplr


Everyone's Recent Snippets Tagged wordpress



This creates a custom HTML header in Thesis with a logo and an advert section (to be used instead of CSS image replacement). Example CSS to use with it: .custom #header:after {content:"."; display:block; height:0; clear:both; visibility:hidden;...
5 372 posted 12 years ago by kristarella
Template Tag body_class The coming WordPress 2.8 provides a new Template Tag, body_class. This function gives the body element different classes, which gives you the possibility to use it effectively with CSS.
3 267 posted 12 years ago by jessibird
This code replaces a normal category template. It sorts all posts by their category/subcategory instead of bunching them all together and ordering them by date. A bit complicated to explain in a box this size... Check the link for a run through!
1 404 posted 12 years ago by rocktronica
If you leave out the "paged" parameter, the same results are queried and shown on each pagination. Of course, you'll want to change the "3" to whichever category you'll want to exclude.
3 415 posted 12 years ago by rocktronica
1 408 posted 12 years ago by gfazioli
Use javascript to add a class of last onto the first and the last li tags in the navigation (add to global.js). Then use css to style. For instance, if the first li is home, you can set the css to hide this link (if you want the logo to act as your h...
5 444 posted 12 years ago by kstetson
To arrange multiple dynamic sidebars in wordpress, add the following code snippet into functions.php. The sidebar should then appear in the dropdown menu in wordpress under the widgets section. Next, go into your sidebar.php file & edit the dynamic s...
2 307 posted 12 years ago by kstetson
Wordpress has a built in class that you can style to style the down nav state for the page you are on. Adjust div name accordingly.
1 380 posted 12 years ago by kstetson
Self-updating copyright
1 342 posted 12 years ago by fabi
Enable the use of Custom Fields in Wordpress. This is the code to put into the markup. Related plugin: get-custom-field-values
0 360 posted 12 years ago by taqin
This example will display the full content of the five most recent posts, and just the headlines from the five before that.
1 373 posted 12 years ago by kwilson
This used to be code adapted from Z'Oc, but I decided to start again and write it fresh with WP_Query instead of get_posts.
3 354 posted 12 years ago by kristarella
2 276 posted 12 years ago by atma
If you run a query to delete old posts manually from MySQL in a WordPress database, the old tags will remain and appear in your tag cloud/listing. This allows you to identify those unused tags, and then delete them with an additional query.
0 318 posted 12 years ago by jkriddle
Recently moved my Wordpress blog to a tumblr account while I was removing a hosting account, wrote this script to do the transfer for me using Wordpress' Export feature and Tumblr's API. It's rough around the edges but gets the job done!
2 656 posted 12 years ago by shakefon
2 315 posted 12 years ago by kristarella
This turns the about page into a featured category post page. The principles for just a regular custom page template with sidebars is there too.
3 598 posted 12 years ago by kristarella
This provides a teaser, with content from a custom feild, or the excerpt if no field exists. Everything except the title and edit link need to be turned off in the options.
3 346 posted 12 years ago by kristarella
this is how to automatically get short urls for your blog posts in wordpress, What you need is to decide which tinyurl service you will be using and get its api URL, for example rinyurl.com , bit,ly, tr.im, here are the api URLS for the mo...
0 413 posted 12 years ago by nerdsane
Down & Dirty Wordpress code to show specific links only to admininstrators. Can be refined using WP roles and Capabilities for more specific needs.
3 329 posted 12 years ago by goddess
Grab 5 latest Wordpress posts and display them on a non-Wordpress PHP page.
1 294 posted 12 years ago by kwilson
Use [short] in a post to insert the text from the function.
2 303 posted 12 years ago by kristarella