Title: Custom CSS causing syntax error
Last modified: August 19, 2016

---

# Custom CSS causing syntax error

 *  Resolved [freetastic](https://wordpress.org/support/users/freetastic/)
 * (@freetastic)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/custom-css-causing-syntax-error/)
 * Hi,
 * I am trying to increase my knowledge by building a custom template for a page
   on my site [Freetastic](http://www.freetastic.co.uk) where this one page brings
   up a different CSS style to all the others.
 * This page is intended to act an article/blog section to the site so the post 
   presentation needs to be different. I have created an Article category and added
   this to the temple to call up just posts under that cat (this was taken from 
   a similar page a friend made for me):
 * ‘<?php if(is_category(’23’)) continue; ?>’
 * It worked, it listed items from category 23 but in the ‘offers’ format. In a 
   bid to change that I have built this from some online guides:
 * ‘<?php
    if(is_category(’23’)) { <link rel=”stylesheet” href=”[http://www.freetastic.co.uk/wp-content/theme/freetastic/style2.css&#8221](http://www.freetastic.co.uk/wp-content/theme/freetastic/style2.css&#8221);
   type=”text/css” media=”screen” /> } else { <link rel=”stylesheet” href=”<?php
   bloginfo(‘stylesheet_url’); ?><” type=”text/css” media=”screen” /> } ?>’ This
   has created a syntax error but I am not sure why:
 * ‘Parse error: syntax error, unexpected ‘<‘ in /home/freetast/public_html/wp-content/
   themes/freetastic/articles.php on line 21’
 * Any suggestions would be greatly appreciated. I can go to our developer if need
   be but I would like to get hands on experience of the basics myself.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [alism](https://wordpress.org/support/users/alism/)
 * (@alism)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/custom-css-causing-syntax-error/#post-1437069)
 *     ```
       <?php
       if(is_category('23')) { ?>
   
            <link rel="stylesheet" href="http://www.freetastic.co.uk/wp-content/theme/freetastic/style2.css" type="text/css" media="screen" />
   
       <?php } else { ?>
   
            <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
   
       <?php } ?>
       ```
   
 * Apologies if that’s wrong, but it’s late and my brain is noodled. 🙂
 *  Thread Starter [freetastic](https://wordpress.org/support/users/freetastic/)
 * (@freetastic)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/custom-css-causing-syntax-error/#post-1437082)
 * That worked beautifully, just need to clean the new style.css up now. Thank you
   for your help!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom CSS causing syntax error’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [freetastic](https://wordpress.org/support/users/freetastic/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/custom-css-causing-syntax-error/#post-1437082)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
