Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged template



This template code will work only in the WordPress Loop to include a map if the Geo Mashup plugin is active and the current post has a location.
0 2028 posted 16 years ago by cyberhobo
Use this code in a WordPress template with the Geo Mashup plugin (see URL) to include a global map within a post or page, centered on that post or page's location, with marker highlighted.
0 1765 posted 16 years ago by cyberhobo
Full example widget available at [WP Engineer](http://wpengineer.com/wordpress-built-a-widget/ "Build A WordPress 2.8 Widget With The New Widget API").
0 1754 posted 16 years ago by chrisdpratt
0 1696 posted 16 years ago by gabbo
This makes template code that applies to children of a particular page much more readable, especially if you can use a page path instead of an ID: `if ( is_child_of( 'topic/subtopic' ) ) :`.
1 2039 posted 16 years ago by cyberhobo
There's no has\_children() function in WP 2.8.4, but get\_children() returns false if the post/page has no children, so it can serve the same purpose in a page template. Outside a page template you'd have to add a global declaration for the $post...
2 2190 posted 17 years ago by cyberhobo
1 1839 posted 17 years ago by iTony
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 3170 posted 17 years ago by kristarella
Put this before the loop in archive.php to have posts in the archive for category '26' sorted by custom field 'date'. Assign sortable values like '090501' or '2009-05-01' to those fields when editing posts and your Upcoming Events will be sorted by...
8 3518 posted 17 years ago by hussong
Skor PHP Template class can assign individual variable values or arrays with several variable values. A separate sub-class extends the base class to support delimited template section replacements.
0 1575 posted 17 years ago by Agundur
3 2661 posted 17 years ago by jimmysessions
2 1851 posted 17 years ago by Jdub7
The following code lets us designate "menu links" that will not actually link anywhere.
0 1783 posted 18 years ago by aleprieto
If you want to use a specific node.tpl.php for a node, paste or merge this code into your template.php
1 1976 posted 18 years ago by aleprieto
Allows to customize the search results page.
0 1474 posted 18 years ago by aleprieto
Makes Drupal Advanced Search form non collapsible and expanded by default.
0 1526 posted 18 years ago by aleprieto
This is a stipped-down version of the original page.tpl.php from Drupal 5.x's Bluemarine theme. Just add your own DIVs.
2 1668 posted 18 years ago by panatlantica
1 1838 posted 18 years ago by Wiederkehr
0 1350 posted 18 years ago by chucktrukk
0 1404 posted 18 years ago by chucktrukk
A per-region override. ogt_blocks is ran for a region, if a region contains blocks, we search for a theme function named theme_region_regionname(). If exists, we run that, else we just return the concatenated blocks for that region.
1 2089 posted 18 years ago by berkes
An easy debug trick: gives you a variable that you can print in any tpl.php to find out what vars you have available there.
1 2459 posted 18 years ago by berkes