• Hi,

    I am trying to load a CSS file only for a specific post template, I called it:

    single-photograpy.php

    which is a custom post template only for pictures posts.
    In the header.php, I can’t find a way to target it.
    This will target any single post (also the normal posts):

    if (is_single()) { ?>
    
    <link href="<?php bloginfo('template_url'); ?>/css/someCSS.css" rel="stylesheet" type="text/css">
    
    <?php } ?>

    while this one simply doesn’t work:

    if (is_single('single-photography.php')) { ?>
    
    <link href="<?php bloginfo('template_url'); ?>/css/someCSS.css" rel="stylesheet" type="text/css">
    
    <?php } ?>

    Is there a way only to target the posts from the single-photography.php custom post template?

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

    THANKS A LOT

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

The topic ‘WordPress conditional’ is closed to new replies.