Hi, the title says it all. I would like to include a css style sheet to the header and some code to the footer when a custom field value exists.
I've tried the following code ->
for the css
function add_css() { ?>
<?php if ( get_post_meta($post->ID, 'fullbg', true) ) : ?>
<link rel="stylesheet" type="text/css" href="<?php echo bloginfo('stylesheet_directory') ?>/thestylesheetiwant.css" />
<?php endif; ?>
<?php }
add_action('wp_head', 'add_css');
and for the footer
function add_footer() { ?>
<?php if ( get_post_meta($post->ID, 'fullbg', true) ) : ?>
<img class="bg" src="<?php echo get_post_meta($post->ID, 'fullbg', true) ?>" alt="<?php the_title(); ?>" />
<?php endif; ?>
<?php }
add_action('thematic_after', 'add_footer');
but it's not working. help would be greatly appreciated