[wp-hackers] how to apply a theme only for a page

Ash Goodman ash at thinkinginvain.com
Thu Apr 22 13:10:23 UTC 2010


I would assign the page or post a meta value using a custom field. Then load
the appropriate style sheet using conditionals.

<?php $your-custom-field = get_post_meta($post->ID, 'your-custom-field',
true); if ($your-custom-field) { ?>
<!-- load your new style sheet -->
<link rel="stylesheet" href="path to your style sheet" type="text/css"
media="screen" />
<?php } else { ?>
<!-- load regular style sheet -->
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"
type="text/css" media="screen" />
<?php } ?>


More information about the wp-hackers mailing list