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

  1. visumdesign
    Posted 3 years 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.


  2. Devin Price
    Plugin Author

    Posted 3 years 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

  • Options Framework
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.