WordPress.org

Ready to get started?Download WordPress

Forums

Style Switcher in Admin ? (10 posts)

  1. Root
    Member
    Posted 9 years ago #

    Would it be possible to set up a style switcher so that it is operated from admin I wonder.? Is there anything in the plugin architecture which could be adapted or built on.? What would be the issues? What we would need to be doing I would think is simply passing a variable into the import url call. I just wonder how difficult that is? My goal would be *single click*. All thoughts gratefully received. Just my 2 c :)

  2. AIMJournals
    Member
    Posted 9 years ago #

    actually... I might work on a plugin for a style switcher. I know there's already one out there, but I might make one that uses my method (javascript) as seen on: http://www.ajblog.uni.cc
    Have to look at how plugins work and stuff first though.

  3. TechGnome
    Moderator
    Posted 9 years ago #

    I think what Root is looking for is the style switch to be controled from the Admin screen, by the site admin, rather than by the user from the blog itself. It's an idea for sure, and has it merits. At the moment, I don't think there's anything that does that, but it can't be all that difficult to make one.... can it?
    TG

  4. Root
    Member
    Posted 9 years ago #

    Thanks you guys. I was beginning to wonder if my q had sunk without trace.
    I can envisage a situation in which a user would like a style switcher controlled by him not the reader of the blog, and not disturbing the design on the front page.
    Admin seems the logical place for it. I envisage a drop in style pack. Tech I do not have your email address. Would you mind ?

  5. chuyskywalker
    Member
    Posted 9 years ago #

    Couldn't you just set an option in the wp_options tables - something like "current_css_file" and have the value be "defualt.css".
    Then in the template add:
    link src="<?php get_site_setting('current_css_file'); ?>"
    (please excuse the aweful coding and obviously incorrect function calls - i know they exists, but as i've only been on wp a few weeks, i don't know them by heart...yet...)
    That should do the trick, then just getting the option to show up in the admin section is all that's left. And that should be a pretty simple hack.

  6. TechGnome
    Moderator
    Posted 9 years ago #

    chuysky - that would seem an ideal choice.... take it one step further, have a page in the admin area where there is a drop down list that could then populatde the option setting.
    Root - you should be able to grab it off my site... just hit either of the "email me" links.
    TG

  7. chuyskywalker
    Member
    Posted 9 years ago #

    Where would the values for that drop down list come from? Scanning a "css" folder? mmm, I don't like that so much.
    If I wanted to use that feature, but my css was on a different server, or something like that, it would be cumbersome. Having a list from a scanned folder AND a text field would make us both happy, but it's too many choices to be practical solution.

  8. Root
    Member
    Posted 9 years ago #

    No this needs an extra field / values in the mysql db surely ?

  9. chuyskywalker
    Member
    Posted 9 years ago #

    @root : that's what I said previous post. This would be another option set via the database, the question is whether the admin section would pull the availble css files from a folder, or simple have a text field to allow people to change the value.
    Either way the value would go into the wp_options mysql table

  10. Root
    Member
    Posted 9 years ago #

    That sounds right but I am not very hot on php. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.