• Resolved freetastic

    (@freetastic)


    Hi,

    I am trying to increase my knowledge by building a custom template for a page on my site Freetastic 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=”https://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)
  • <?php
    if(is_category('23')) { ?>
    
         <link rel="stylesheet" href="https://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

    (@freetastic)

    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.