This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Search Form for Custom Post Type Only--> | |
<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> | |
<input type="text" name="s" id="s" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/> | |
<input type="hidden" name="post_type" value="art" /> | |
<input type="submit" id="searchsubmit" value="Search Art" /> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php wp_reset_query(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: redirect to first child | |
*/ | |
if (have_posts()) { | |
while (have_posts()) { | |
the_post(); | |
$pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order"); | |
$firstchild = $pagekids[0]; | |
wp_redirect(get_permalink($firstchild->ID)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
query_posts( 'post_type=projects&posts_per_page=5&paged='.$paged); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$currentdate = date("Y-m-d"); | |
$wp_query = new WP_Query(); | |
$wp_query->query('cat=4,5&posts_per_page=6&meta_key=date&orderby=meta_value&order=ASC&meta_compare=>=&meta_value=' . $currentdate .'&paged='.$paged); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get total number of pages | |
global $wp_query; | |
$total = $wp_query->max_num_pages; | |
// only bother with the rest if we have more than 1 page! | |
if ( $total > 1 ) { | |
// get the current page | |
if ( !$current_page = get_query_var('paged') ) | |
$current_page = 1; | |
// structure of “format” depends on whether we’re using pretty permalinks | |
$format = empty( get_option('permalink_structure') ) ? '&page=%#%' : 'page/%#%/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul id="nav"> | |
<?php wp_list_pages('sort_column=menu_order&include=2,8,10,6&title_li='); ?> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //List All Terms from Custom Taxonomy | |
$args = array( | |
'taxonomy' => 'shop_artists', | |
'orderby' => 'name', | |
'hierarchical' => False, | |
'title_li' => '<h2>Artists</h2>' | |
); | |
?> | |
<ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this_page = get_post($id); | |
$parent_id = $this_page->post_parent; | |
if ($parent_id) { | |
$parent = get_page($parent_id); | |
echo '<a href="'.get_permalink($parent->ID).'" title="back to Portraits & Stories list">« back to Portraits & Stories list</a>'; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Your twitter username. | |
$username = "Antinym"; | |
// Prefix - some text you want displayed before your latest tweet. | |
// (HTML is OK, but be sure to escape quotes with backslashes: for example href=\"link.html\") | |
$prefix = "<h2>The Latest on Twitter</h2>"; | |
// Suffix - some text you want display after your latest tweet. (Same rules as the prefix.) | |
$suffix = ""; | |
$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1"; | |
function parse_feed($feed) { |