Gravity Forms taxonomy fix

<?php
//Tag to Taxonomy - A fix for gravity forms

function hyp_tag_to_taxonomy( $form ){
$id = $form['post_id'];
$raw_tag_list = $form['12'];
$tag_array = explode(',', $raw_tag_list);

foreach ($tag_array as $tag){
wp_set_object_terms( $id, $tag, 'collective',true);
}
}

add_action( 'gform_post_submission', 'hyp_tag_to_taxonomy' );

?>

The Date

<?php
$time = time();
echo date("m/d/y G:i:s e", $time);
echo "<br/>";
echo "Today is ";
echo date("jS of F Y, a\t g:ia i\n e", $time);
?>

Register custom taxonomy

<?php
add_action( 'init', 'create_my_taxonomies', 0 );

function create_my_taxonomies() {

register_taxonomy( 'my_new_taxonomy1', 'post', array( 'hierarchical' => false, 'label' => 'My New Taxonomy1', 'query_var' => true, 'rewrite' => true ) );

register_taxonomy( 'my_new_taxonomy2', 'post', array( 'hierarchical' => false, 'label' => 'my_new_taxonomy2', 'query_var' => true, 'rewrite' => true ) );

}

?>

<!-- For your post to display tag cloud for your new taxonomy -->

<?php wp_tag_cloud( array( 'taxonomy' => 'my_new_taxonomy1', 'number' => 45 ) ); ?>

<!-- /End -->

<!-- Display taxonomy terms for each post -->

<?php echo get_the_term_list( $post->ID, 'my_new_taxonomy1', 'My New Taxonomy1: ', ', ', '' ); ?>

<!-- /End -->

<!-- Show posts from a certain taxonomy -->

<?php query_posts( array( 'people' => 'will-smith', 'showposts' => 10 ) ); ?>

Force favicon for a page

<!-- This will add favicon to browser, by force if you can't get your favicon to show up due to server defaulting to another favicon. Note: Internet Explorer may cache favicons, to clear them out delete associated bookmark from favorites and then delete all history and cookies. -->
<link rel="SHORTCUT ICON" href="http://hyperspatial.com/favicon.ico"/>

PHP redirect using query string

<?php

$redirect = $_GET['redirect'];

/* Browse to http://hyperspatial.com?redirect=true
to access the redirect page */

if($redirect == "true")
{
header('Location: http://hyperspatial.com/redirect_page.html');
exit();
}

else header('Location: http://hyperspatial.com');
exit;

?>

Display search result count

<!--test post count-->

<h2 class="pagetitle">Search Result for <?php /* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(''); _e('<span class="search-terms">'); echo $key; _e('</span>'); _e(' &mdash; '); echo $count . ' '; _e('articles'); wp_reset_query(); ?></h2>

<!--/test post count-->

Shadow effect

-moz-box-shadow:0 1px 3px rgba(0,0,0,0.5);
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5);
text-shadow:0 -1px 1px rgba(0,0,0,0.25);
border-bottom:1px solid rgba(0,0,0,0.25);
box-shadow:0 1px 3px rgba(0,0,0,0.5);

Display custom field on page

<!-- Custom Fields AJN -->

<?php

$my_custom_field = get_post_meta($post->ID, 'myCustomFieldName', true);

if ($my_custom_field == '') {

//Empty Field - Do not display
}

else {
echo '<p><strong>Heading for your post: </strong><br />' .
$my_custom_field . '</p>';
}

?><!-- End Custom Fields -->