WordPress.org

Ready to get started?Download WordPress

Forums

OptionTree
Background Option (5 posts)

  1. eric.w
    Member
    Posted 1 year ago #

    When I use <?php echo(ot_get_option('custom_background_css|background_color')) ?> it returns nothing but when I use <?php echo(ot_get_option('custom_background_css')) ?> it returns all the values set through the options page but it returns them all with commas. I need to be able to call it without commas or individually. Can anyone help me?

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

  2. eric.w
    Member
    Posted 1 year ago #

    I meant <?php echo(ot_get_option('custom_background_css|background-color')) ?> I tried both just to make sure. Thanks in advance!

  3. vabmedia
    Member
    Posted 1 year ago #

    Hey Eric W.

    I don't think you have to call the option in the php file.
    You set up a custom background option on the options page, and along with it, you have to set up a css option and add the css code to the css box that was created when you created a css option.

    You also have to create a file called dynamic.css, (call this file from your header.php) so that whatever you write in the css box, will show up on that file dynamically, and that will help you set up your background.

    In the css box in your theme options you would have the following:
    #homelayout{
    {{home_content}}
    }

    where home_content is the id name of the background option I(you) set up.

  4. eric.w
    Member
    Posted 1 year ago #

    Hello Vabmedia! Thank you for your response. I guess I am missing something. Tyring to follow your instructions and documentation as well. I have created dynamic.sss and placed this code inside `.all-container {
    {{custom_background}}

    }` custom_background is the option. I called the stylesheet from header.php I also changed permissions on that file to 777. What am I missing?

    Right now I use a dynamic.php that has worked great. Thats why I was trying to call them through php. Here is an example of how I thought it should look. `

    <?php { ?>
    <style type="text/css">
    .all-container {

    background: <?php echo(ot_get_option('custom_background')) ?>;
    }
    </style>

    <?php } ?>
    `

    That however, doesn't work.

    Any and all help would be greatly appreciated. Thank you!

    Eric

  5. eric.w
    Member
    Posted 1 year ago #

    last message i meant to say dynamic.css

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic