Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It looks like after only two days of trial and error, I found a solution, or rather, a workaround to this problem. I followed a tutorial on how to switch stylesheets from within a theme options page. The tutorial is called <a href="http://fearlessflyer.com/2009/12/add-a-style-switcher-to-your-wordpress-theme/" rel="nofollow">Add a Style Switcher to your WordPress Theme</a>. In this tutorial the author switches external stylesheets from a selection drop down menu. In my code, I swapped out the external stylesheets for embedded stylesheets. In the case of my question above, that would be the test1 and test2 functions.</p> <p>A code example would be:</p> <p>Add a new array at the top</p> <pre><code>array ( "name" =&gt; "Restore CSS", "desc" =&gt; "Restore the original heading text", "id" =&gt; $shortname."_restore_css", "type" =&gt; "select", "options" =&gt; array ("select an option", "test2"), "std" =&gt; "Logo CSS" ), </code></pre> <p>Then add a new function, in this case called css_switcher</p> <pre><code>function css_switcher() { //opens css_switcher function global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?&gt; &lt;!-- logo stylesheet goes outside of switch statement --&gt; &lt;?php switch ($co_restore_css) {//opens switch statement case "select an option": //nothing goes between this closing php tag and // next opening php tag, to make select an option do nothing ?&gt; &lt;?php break; case "Restore CSS": ?&gt; &lt;!-- restore stylesheet goes inside of switch statement --&gt; &lt;?php break; }//closes switch statement }//closes css_switcher_function add_action('wp_head', 'css_switcher'); ?&gt; </code></pre> <p>This worked for me.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload