SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    634
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    css for sub templates work in local sandbox but not live

    dang I am just having so much fun this weekend....

    but seriously:

    I have this link calling the css for the sub template in the header.

    <?php if(is_page_template('subTemplateEngineer.php')) {?>
    <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/subtemplate01.css">
    <?php }?>

    and of course the correct .css in the css folder.

    I can see the results on my sandbox. when I upload it live the css styling doens't show up.
    already checked three or four times that all the files xfered properly. I check to ensure that the appropriate sub template was applied to the pages.
    a bit at a loss.

    I also later tried adding the following code to the style.css

    @import url('/css/subTemplate01.css');
    @import url('css/contact.css');

    zilch...no better results.
    (and yes I was checking to see if maybe i was a directory off hence the missing "/" in one of the links)

    Anything else I can try?
    thx
    D

  2. #2
    SitePoint Addict bronze trophy
    Join Date
    Mar 2013
    Location
    Oneonta, NY
    Posts
    307
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Pdxsherpa,

    Are you sure your css document is on your server? On a side note, you should avoid importing css documents and use different syntax if possible. You could also try the different syntax to see if that works.

    For example:

    <link rel="stylesheet" href="/path/to/your/stylesheet.css" />

    Hope that helps,

    Shawn

  3. #3
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    634
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    hello shawn.
    thank you for your inputj, as i stated above I am pretty sure the files did xfr to the server. checked at least three times (stopped counting at three anyway.)
    as for the sintax, i'll give your suggestion a shot. but wp uses paths differently, (for security reasons i guess) and in the sample above i am telling it that if i used a certain sub template the page needs to use a diff css.

    Quote Originally Posted by smanaher View Post
    Pdxsherpa,

    Are you sure your css document is on your server? On a side note, you should avoid importing css documents and use different syntax if possible. You could also try the different syntax to see if that works.

    For example:

    <link rel="stylesheet" href="/path/to/your/stylesheet.css" />

    Hope that helps,

    Shawn

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,433
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    I've never had to do it so I could very well be out in left field, but maybe this is something where wp_enqueue_style() would help?

  5. #5
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    634
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Mittineague, thank you had never even heard of that will try it out and see if it works.
    one of my co-workers opined that the php was to blame.
    crossing fingers and thank you for that suggestion.

  6. #6
    SitePoint Addict bronze trophy
    Join Date
    Mar 2013
    Location
    Oneonta, NY
    Posts
    307
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pdxSherpa View Post
    wp uses paths differently
    I'm not sure of your exact configuration but I've coded numerous WP sites and you can use virtually any syntax that can be applied to any other kind of website including the one I mentioned. An http request is an http request. If you instruct a browser to fetch a document in order to render a page, as long as the path is correct and you are using an http request method supported by the browser, it shouldn't matter whether the request is embedded in a WP template or not.

  7. #7
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    634
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    smanaher, i am sure you have more experience than me. so i'll take your word for it and give it a try.
    Thank you.
    D


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •