WordPress.org

Ready to get started?Download WordPress

Forums

Stylesheet selector in functions.php (8 posts)

  1. futurenow
    Member
    Posted 8 years ago #

    I am developing a theme where I want to give people the option to select from a range of header images and also change the core colour of the header text (primarily) eg h1,h2,h3 etc. I have set up the header image selection no problem, but am struggling with enabling it so people can select different stylesheets to give them a different colour scheme. I want this to all work from within functions.php.

    Any suggestions?

  2. Austin Matzko
    Member
    Posted 8 years ago #

    Add a function to the wp_head action hook that will echo out your CSS settings. That way changes will appear instantly in the WP header.

    function add_stuff_to_header() {
    echo $stuff;
    }
    add_action('wp_head','add_stuff_to_header');

  3. jevrinx
    Member
    Posted 8 years ago #

    hi ive posted a problem about themes can u help out?
    my theme wont display on other PCs

  4. petit
    Member
    Posted 8 years ago #

    Dont' jump into every thread you see.
    Keep with the thread you started.

  5. _codedog
    Member
    Posted 8 years ago #

    This main wordpress website needs a small CSS upgrade to fix printing. My suggestion is:
    @media print {
    #sidebar { display:none; }
    #bodyContent { position:absolute; left:0; }
    #content { width:100%; }
    #toc { display:none; }
    #footer { display:none; }
    #menu {display:none; }
    .editsection { width:100%; }
    }

    This allows the content (middle) section of the page to takeup the whole page when printed. This can be added to IE as a user-prefered CSS; however, what about "real" browsers. It would be good to have this in the wordpress.org page so we can print Documentation properly.

  6. futurenow
    Member
    Posted 8 years ago #

    I actually want people to be able to select a totally different stylesheet within functions.php. How would I go about this?

  7. josalmon
    Member
    Posted 8 years ago #

    I've been looking for ways to do this too. I've got a few photos that I'd like to make into headers and then I want different link colours etc depending on the photo but I don't want to create different themes to change via a theme switcher as then any changes you make to one sidebar have to be made to them all....

    I'd love it if there was a way for users to pick the stylesheet.

  8. Yngwin
    Member
    Posted 8 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic