21 posts
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
  • Located in United States
Wex says
<?php if( get_post_meta($post?>ID, ‘style’, true) == ‘alternative’ ){ ?>

Reaper made a small typo it should be $post->ID.

However I don’t think this is the best way to go about this. As this code does not make sense for the homepage for example.

You can try using is_single() or is_page() conditional tags if you know the id of the post you want to style differently

something like
  <link href="<?php bloginfo('template_directory'); ?>/alternative.css" rel="stylesheet" type="text/css" />
<?php }else{?>
  <link href="<?php bloginfo('template_directory'); ?>/style.css" rel="stylesheet" type="text/css" />
<?php }?>
Is there a custom field I need to put in the page that I’m assigning a different style sheet for this?

Not with that bit of code. I think your problem would actually be fixed perfectly with Reaper-Media’s solution, which he seems to have updated: http://themeforest.net/forums/thread/how-do-i-assign-a-specific-style-sheet-to-one-of-my-worpress-pages/28183?page=1#263432

His does require that you add a custom field, but it’s all explained in his post.