Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged wordpress



0 584 posted 14 years ago by crs
Using this loop variation you can style differently the first and the last post of a loop, or whatever post you like, as lond as you add a new elseif with the number of the post you desire.
5 776 posted 14 years ago by crs
Adds two "sidebars" to the header. You can drag and drop widgets into them just like any other sidebar from your WP dashboard. You can change the Hook to move the "sidebars" somewhere else on the page. For example, change 'thesis_hook_header' to '...
4 846 posted 14 years ago by fouroclockproject
Completely changed original function, which stopped working around WP2.8.
1 605 posted 14 years ago by kristarella
All you need to do when writing the post, is enter a custom field with the key "expiration" and set the value in the format: "2010/01/01 18:20:00" - this would expire the post at 6.20pm on the 1st January 2010.
1 588 posted 14 years ago by gjindancer
I pieced together this code when I had to do this for a client: - show the first image attached to a post (based on sort order in gallery tab) in medium size - put all the other images attached to the post into an imageset so that when you click on...
1 840 posted 14 years ago by zartgesotten
This will output the resulting meta value (notice the addition of "echo"):
1 600 posted 14 years ago by rickfu
In this Thesis WP tutorial for multiple custom page templates, we find code for making a custom homepage template as well.
2 647 posted 14 years ago by mlangfeld
This code to be added to custom_functions.php May also need to add to custom.css to style your custom widget. (This code found towards the end of the article).
2 709 posted 14 years ago by mlangfeld
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 732 posted 14 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 480 posted 14 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 743 posted 14 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 747 posted 14 years ago by rocktronica
1 732 posted 14 years ago by gfazioli
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 581 posted 14 years ago by kstetson
Self-updating copyright
1 596 posted 14 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 667 posted 14 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 700 posted 14 years ago by kwilson