WordPress.org

Ready to get started?Download WordPress

Forums

Options Framework
Using if statement in dynamic stylesheet? (2 posts)

  1. visumdesign
    Member
    Posted 1 year ago #

    I want to give the option of either having a fixed header or not..

    #header {
    	<?php if ( moon_get_option('example_checkbox') ) { ?>
        position: <?php echo moon_get_option('example_checkbox', 'fixed' ); ?>;
        width: 100%;
        z-index: 1;
    	<?php } ?>
    }

    I am slowly learning php, and I know that I can say if example_checkbox is set to true then echo the text "fixed", I am pretty sure that's the best way to do it, but I don't know how to say that in php yet, so if you have any idea I would really appreciate it.

    This would be very powerful and could really help my theme development if I could get some insight on using if statements with dynamic CSS..

    I searched for an answer for this and couldn't find much.

    http://wordpress.org/extend/plugins/options-framework/

  2. Devin Price
    Member
    Plugin Author

    Posted 1 year ago #

    You could output it as inline styles. Take a look at Portfolio Press (http://wordpress.org/extend/themes/portfolio-press) and see how I did it there.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.