WordPress.org

Ready to get started?Download WordPress

Forums

OptionTree
[resolved] dynamic.css file problem or background issue (8 posts)

  1. Mimergt
    Member
    Posted 1 year ago #

    Hi everybody...
    I have problem tryng load my dynamic.css file.

    I have an Background option named "headbg" in my OT panel...

    I add my dynamic.css file to my theme and any problems....

    <!-- the dynamic stylesheet of OptionTree Custom css -->
    <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('template_directory');?>/dynamic.css" />

    ok, in my dynamic.css file i have this code:

    #header {
    {{headbg}}
    }

    The Id of my header is "header" =) so... the problem is when i load my front page... any changes... i made a lot of changes in the option panel and save it but that's same...

    When i see the htlm code loaded by the theme the dynamic.css file is loaded but the code iside not is CSS... this is the result in the front end...

    <link href="http://the_correct/path/of_my/theme/dynamic.css" media="all" type="text/css" rel="stylesheet">
    #header {
    {{headbg}}
    }
    </link>

    I trying change the path of the dynamic.css, the file have 777 permitions and the theme folder... and the wp-content but nothing works.

    I'm searching along in the git repositories and here but any solve my problem.

    My Wp version is 3.4.2...

    Tnks alot for responses =)

    http://wordpress.org/extend/plugins/option-tree/

  2. arvish
    Member
    Posted 1 year ago #

    Exactly the same issue here.

    Resorting to embedding the CSS within "style" tags using PHP but the dynamic.css would be so much better.

  3. Derek Herman
    Member
    Plugin Author

    Posted 1 year ago #

    I just want to be sure that you are indeed using the CSS option type and adding the code below to the textarea and saving OptionTree? And that you are not pasting that code into the dynamic.css file.

    #header {
    {{headbg}}
    }
  4. arvish
    Member
    Posted 1 year ago #

    Thank you for your message Derek.

    Well according to the documentation you are meant to create a file called dynamic.css and write the code with the template placeholders in it e.g

    #header {
    {{headbg}}
    }

    It would be great if you could elaborate on what mean as the instructions are a bit confusing.

  5. Derek Herman
    Member
    Plugin Author

    Posted 1 year ago #

    I thought the CSS option type was documented pretty well. What's confusing? You add a CSS option type and insert the code into the textarea and when you save it will dynamically insert the correct CSS into the file.

  6. arvish
    Member
    Posted 1 year ago #

    Thank you again for your reply Derek. Your support and guidance is much appreciated.

    OK I wish I would agree with you with regards to the documentation. It is a nice piece of software but the documentation could be a lot better.

    It does not specify where the CSS option type textarea should be placed. Should it be in every section or just once?

    Perhaps in a new release you could add the CSS option type textarea by default and another idea would be to generate the template placeholders by default as well.

    That said I am still having issue getting the file to write. I added a section and added a CSS option type to that, paste the following

    #header{
    {{header_bg}}
    	}

    dynamic.css is present at the root folder with CHMOD 777.
    Tested write permissions using a php script and it works fine.

  7. Derek Herman
    Member
    Plugin Author

    Posted 1 year ago #

    You create as many CSS option types as you like. Each one will insert into the dynamic.css file for you with comments about which option is being generated above the CSS. So for example, when you create your CSS option and give it an ID of header_css and paste the following code into it:

    #header {
        {{header_bg}}
    }

    you would get the following inside the dynamic.css file:

    /* BEGIN header_css */
    #header {
        DYNAMIC CSS WOULD BE INSERTED HERE!
    }
    /* END header_css */
  8. snails07
    Member
    Posted 1 year ago #

    I also wasn't clear on where to put the actual CSS.
    I was pasting it into the dynamic.css file itself as well.

    After reading the docs again it is actually pretty clear

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic