• Resolved alexthecatta

    (@alexthecatta)


    Problem: I need to use a specific CSS style sheet for pages built with a custom template I’ve created, and another CSS style sheet for pages built with the standard template.

    I’ve found this (closed) topic

    https://www.ads-software.com/support/topic/attaching-different-css-styles-to-different-page-templates-please-help

    but don’t know how to make works the following code:

    <?php
    if ( is_page_template('my_new_template.php')) { ?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/my_new_template.css" />
    <?php } ?>

    [Please post code snippets between backticks or use the code button.]

    I have to change my_new_template.php and my_new_template.css with my file names. What about ‘template_directory’? Sorry if questions may sound stupid, but I’m new to PHP.

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘different css for each page’ is closed to new replies.