A WordPress theme for all

Under the heading of the blog, on the left, just above the navigation bar, there is a "switch" that allows you to switch to an alternate graphic theme, namely "clear".

The graphic theme of a blog is chosen by the blog owner himself, or if it is created by hand, whether it was downloaded from the network. The end result, however, in addition to "us" owners should be pleased by our visitors who do not always appreciate certain layout choices. For some it will be trivial for other wonderful, for others still terribly annoying! So why not to choose the "visitor" to display the layout with our blog?

Everything stems from the stresses of Emmanuel to propose a version of "clear" of undolog.com! How do you blame him? However, if I followed his advice, I should do it with others, and the consequence would be to find themselves subject to change every week! Despite this you are "readers / viewers" to read the blog, so why not provide a tool that can make the best possible viewing sceggliere? Along with other interesting perspectives ...

In addition, there are those who never ever fully satisfied with the theme that has (see Napolux ) and a tool like WP Theme Choose Your might, in part, solve the problem, ensuring a double navigation on a new theme, or after trial, and the consolidated accounts for the "loyal".

So I listened to Emanuel and I created a version of "clear" of this blog . I realized, for the occasion, a simple plugin that allows you to view the list of available themes and select them from the front end of WordPress. In practice, will be the visitors to choose how to view our Blog!

Choose Your WP Theme

Choose Your WP Theme for WordPress plugin is able to choose the theme of the visitor to use. The choice is stored via cookies, and in this version, available for about a month. Its operation is very simple: just install, activate, hide, via configurations, the issues that we do not want to select for our visitors and add this line in "your template, for example in the sidebar ( sidebar.php ):

1
2
<h2> Choose Theme </ h2>
; ?> <? Php wp_chooseyourtheme ();?>

The issues permits will be displayed in combo menu. When the visitor selects a theme, this will be stored in the cookie and reload the page. In this release, the plugin allows for three types of display.

Parameters

The list of topics can be presented in three ways:

Combo Menu

1
2
3
4
<h2> Choose Theme </ h2>
; ?> <? Php wp_chooseyourtheme ();?>
/ / Or
"mode=menu" ) ; ?> <? Php wp_chooseyourtheme ('mode = menu ");?>

This generates an HTML:

1
2
3
4
5
"wpcyt_combo" > < select class = "wpcyt_combo">
option > < Option > Theme 1 name </ option >
"selected" > Theme name 2 < / option > < option selected = "selected"> Theme name 2 </ option >
option > < Option > Theme name ... </ option >
</ select >

List

1
2
<h2> Choose Theme </ h2>
"mode=list" ) ; ?> <? Php wp_chooseyourtheme ("mode = list");?>

This will generate a highly customizable HTML, as in the example below:

1
2
3
4
5
"wpcyt_list" > < ul class = "wpcyt_list">
"nome-tema-1" >< a href = "..." >< span > Nome tema 1 < / span >< / a >< / li > < them class = "theme-name-1"> < a href = "..."> < span > Name Theme 1 </ span > </ a > </ them >
"nome-tema-2 selected" >< a href = "..." >< span > Nome tema 2 < / span >< / a >< / li > < them class = "theme-name-2 Selected"> < a href = "..."> < span > Name Theme 2 </ span > </ a > </ them >
"nome-tema-n" >< a href = "..." >< span > Nome tema n < / span >< / a >< / li > < them class = "n-theme-name"> < a href = "..."> < span > n the subject name </ span > </ a > </ them >
</ ul >

. The current theme is indicated by the addition of the class selected tags in li . In the version of the current theme combo menu is automatically selected in the list.

Roll

1
2
<h2> Next topic </ h2>
"mode=roll" ) ; ?> <? Php wp_chooseyourtheme ("roll mode =");?>

In this case creates a single link pointing to the next topic, cycling virtually all the topics available:

1
2
3
"wpcyt_roll" > < div class = "wpcyt_roll">
"prossimo-tema" href = "#" >< span > Prossimo Tema < / span >< / a > < a class = "next-theme" href = "#"> < span > Next Issue </ span > </ a >
</ div >

Advantages and potential

As said earlier the main advantage it offers to the navigator that can set a theme navigation over another. The higher the number of subjects available, the greater the ability to meet the diverse needs of our sailors. One issue, then, to WordPress, not just a mere look and feel. In addition to "simple" layout, which includes the graphic, the colors, font type and placement of content, you need to add the capability to WordPress can be customized in the vision of this content. With the introduction of appropriate functions it is possible to add a different way of enjoying the blog that is not limited to the simple change in appearance.

Disadvantages and warnings

All this obviously has a price, paid in full by the owner of the blog. In the first analysis it is clear that more issues means higher cost of routine maintenance of the blog. Any additions made on a subject must necessarily be on another riprosta: PayPal buttons, banners and all the items exempt from the contents of the WordPress database. ), ad esempio. For example, the same Plugin WP Theme Choose Your although installed at "global" education requires manual entry wp_chooseyourtheme() in the sidebar ( sidebar.php ), for example. If we have made available three themes, all three should be included education, or to change the theme you would not know how to go back and select a different theme.

In addition, as mentioned above, the use of cookies to inform the system that this particular user has chosen that particular topic, may conflict with some plugins. For example, I had some problems with WP Super Cache is not new to this type of problem. However I think I solved it by editing the file .htaccess . Look for the / lines:

1
RewriteCond% {HTTP: Cookie} !^.*( comment_author_ | wordpress | wp-postpass_) .* $

and change them at:

1
RewriteCond% {HTTP: Cookie} !^.*( comment_author_ | wordpress | wp-postpass_ | wpcyt_name) .* $

wpcyt_name is the name of the cookie used by WP Choose Your Theme

20 comments to "A WordPress theme for all"

  1. June 4, 2009 Saidmade "WP Choose your theme: Wordpress Multi-themes:

    [...] Choose Your WP Theme is a WordPress plugin able to choose a graphic theme to our visitors to use when navigating our blog. The origins of this project can find in a WordPress theme for all. [...]

  2. June 4, 2009 Ghidi :

    Great plugin!

    For the problem of having to update all the issues every time, you can create themes using the alternative child themes, do not you think?

  3. June 4, 2009 Napolux :

    There are already plugins that do something like this theme switcher? : P

  4. June 4, 2009 Napolux :

    Ps
    A thousand times better than the clear theme, if I : P With some aggiustatina graphics would be perfect. : P

  5. June 4, 2009 Emmanuel :

    Thank you for your attention shown to the users! ;-)
    Regarding the subject, as stated by Napolux, should correct a couple of things. I guess it's still under work but for example the green buttons in the comments are ugly.
    Another thing ... why not work on CSS instead of having to create a completely new template with a totally different path for the images (of course, some choices must be reviewed: see for example the comment submit button ...)?
    Hello,
    Emmanuel
    PS: I confirm that plugins like this existed! :-P

  6. June 4, 2009 Giovambattista Fazioli :

    @ Napolux:

    There are already plugins that do something like this theme switcher?

    Yes, there are already ... but better to have it on their own :) Then I hope that mine is better :)

  7. June 4, 2009 Giovambattista Fazioli :

    @ Napolux:

    With some graphics would be perfect aggiustatina

    Suggest you suggest ... ... :)

  8. June 4, 2009 Giovambattista Fazioli :

    @ Emmanuel: There would also be different solutions. However, I chose the most brutal and redundant to allow to act effectively on all the theme files. My goal, in fact, not only to change the look and feel understood as colors and images, but also allow you to change the navigation will have access to new templates, additional functions in the file functions.php , etc ...
    Paino floor, however, thanks to your suggestions, settle the details of the version "white" ... :)

  9. June 4, 2009 Sniper Wolf :

    Very nice this white version. I noticed that the Adsense bannerino under tags, links remained black with greenish ;)

    However, a good job, although I really like the black version of the most Undolog.

    Hello

  10. June 4, 2009 Giovambattista Fazioli :

    @ Sniper Wolf:

    I noticed that the Adsense bannerino under tags, remained black

    Yes, this happens because AdSense is an external service set outside the context of the topic. What should I do (time tyrant ...) is to create a new AdSense for ... I will see this issue as soon as possible :)

  11. June 4, 2009 Giovambattista Fazioli :

    @ Ghidi:

    For the problem of having to update all the issues every time, you can create themes using the alternative child themes, do not you think?

    Good point! Actually I did not mention the WordPress Child Theme because they are little known and little used also, at least by the vast maggiornaza bloggers are not technical. Often, in fact, it is easier (and is also known to be the most) install different themes, thus separating the physical folders.
    However, your observation is very just and Child Theme would be the perfect solution for those who want to create a variation of your theme using the theme of father's inheritance. Topic which could be debated in the near future ... :)

  12. June 4, 2009 camu :

    Giovambattista, do not stand to hear all the time Emanuel, is one who is leading a battle around the entire blogosphere to remove the issues blacks . Seriously, this version is really pretty clear and more readable. I come from the theme changes once a month, but if you told me you were working on a plugin I waited! Failing that, I added a little 'controls and features inside of my theme, to do something similar to yours. In my case I have 12 themes, one for each month. More high-contrast 2: light and dark. The user can choose which one to use as I just explained in my article. I have not made it easy to change because I would like, however, the majority continued to use what I choose, I basically am the master of the house, right?

  13. June 4, 2009 Giovambattista Fazioli :

    @ Camu: :) as blame you ...

  14. June 5, 2009 Emmanuel :

    Camu ahaha! It should be elegance! :-P
    The themes blacks saw them well 10 years ago! ;-)
    Hello,
    Emmanuel

  15. June 6, 2009 The best of the week # 20 | BigThink :

    [...] A WordPress theme Choose Your Theme for all WP, a plugin was created specifically to allow the visitor to choose which theme to show on your blog. [...]

  16. June 7, 2009 Best of Week # 23 | Gioxx's Wall :

    [...] A WordPress theme for all [...]

  17. June 10, 2009 David Salerno :

    With Safari 4 does not act as the switch of the theme ... could be a problem with JavaScript :-(

  18. June 10, 2009 Giovambattista Fazioli :

    Salerno @ David: Yes, Safari has an anomalous behavior, on both Mac and Windows. It could be due to the internal cache of Safari. On the Mac I change the theme it worked, but on and off. I investigate ... (Windows Safari went even crash)

  19. October 5, 2009 Saidmade "WP Choose your theme:

    [...] Choose Your WP Theme is a WordPress plugin able to choose a graphic theme to our visitors to use when navigating our blog. The origins of this project can find in a WordPress theme for all. [...]

Leave a comment

XHTML TAG PERMIT: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL