• Resolved fernandolawl

    (@fernandolawl)


    Just a quick question.
    If I want my archive.php to not use style.css and to use a different custom made style instead, how do I do that?

    I learned that I could do it with template pages using this code and it worked but I can’t get it to work for archive.php. Any help would be great! Thanks in advance!

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <!-- management script -->
    <?php
    if ( is_page_template('page-about.php')) { ?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/about.css" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/main.css" />
    <?php } ?>
Viewing 1 replies (of 1 total)
  • Thread Starter fernandolawl

    (@fernandolawl)

    I figured it out in case anyone was wondering. All you do is have to change the is_page_template code to is_archive. Here is the snippet of code below.

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    
    <?php
    if ( is_archive()) { ?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/blog.css" />
    <?php } ?>
Viewing 1 replies (of 1 total)

The topic ‘Archive.php custom css?’ is closed to new replies.