Sunday, June 6, 2010

Custom css for article

February 3, 2010 by admin · Leave a Comment 

Each article is a challenge and can bring new ways  for you to show information.

So if you need to present different articles with different CSS then you can do the following work:

Add to header.php file the next code:

<?php if (is_single()) {
$customstyle = get_post_meta($post->ID, 'customstyle', true);
if (!empty($customstyle)) { ?>
<style type="text/css">
<?php echo $customstyle; ?>
<style>
<?php }
} ?>

Then you could add for every article a field called customstyle and add there you css style.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • FriendFeed
  • Netvibes
  • Reddit
  • RSS
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Twitthis
  • Blogosphere News
  • email
  • LinkedIn
  • Linkter
  • Live
  • MyShare
  • MySpace
  • Ping.fm
  • StumbleUpon
  • Technorati
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Related posts:

  1. Wordpress – external link to an article
  2. show most commented pages with images in Wordpress
  3. Custom post types with custom taxonomies
  4. How to create a custom post type in Wordpress 3.0
  5. add an expiration date to your article

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

SEO Powered by Platinum SEO from Techblissonline