Woohoo. This is just what I wanted. You're the man Alex!!
Woohoo. This is just what I wanted. You're the man Alex!!
Nice job Alex, you continue to impress everyone. Have you found that this works better than the javascript version offered say, on A List Apart's site? That's the one I use, and I like the fact that I don't have to reload between style switches and the other sheets are offered as alternates for browsers that support it. However, it tends to get buggy sometimes, and I've been looking for a better (read: PHP) alternative, this might be it.
Nice styles too!
uplink
Yep - time to upgrade. :)
Fixed a bug: Some of the links weren't "clean permalink" aware in the first release.
Here's a site for templates and Word Press is one of the choices! Template Generator. It's the cutest site! :)
That site is pretty cool... I'm not sure if they've updated the WordPress functionality to work with the 1.0+ versions of WordPress (the site has been around for quite a while now)... But it's worth a shot!
I never could get it to generate the right files.
Cena, I just pull apart the template and make it a little more friendly. I'm just looking at the .CSS anyhow as I love how my templates are. :)
Ok I've visited some of the other sites using this script and I hope I got this right
1. The ?php wp_style_switcher(); ? include only calls WP-Default, correct?
2. to switch to the other templates I just need to add a link to the folder like so
http://mysite.com/index.php?wpstyle=mystyle. Is this right?
Please let me know if I'm doing this the correct way, as I took it as once I added a style folder to the wp-style directory a link for the style would be outputted by the style_switcher. I hope this makes since.
HAHA ok I think I've got it. I was renaming my style sheets, but all the stylesheets must remain as style.css in order to show. I hopes this helps another newb. Peace
The wp_style_switcher() function puts a list (of the styles you have installed) on your page so people can switch between them.
Hopefully with the CSS Style Competition, there will be a nice collection of styles available very soon.
Is there a version of this to say point the site to look for required files in a different folder?
For example, I made my layout in dreamweaver, and use a bunch of PHP includes for different parts of the site.
Is there a way something like this could be modified to look for index.php, wp-comments.php etc etc in a different folder to skin the site that way?
You can skin your site the traditional way. I have a tutorial here. :)
mtanner wrote: "HAHA ok I think I've got it. I was renaming my style sheets, but all the stylesheets must remain as style.css in order to show. I hopes this helps another newb. Peace"
Thank you! I was wondering what I was doing wrong! :)
I've written an addition that add the title attribute to the style tag where wp_style_switcher is called. This is especially handy for Mozilla where you can now use the CSS-changer button in the bottom left corner of the status bar.
Add this to the bottom of your wp-style-switcher.php:
function wp_style_name($default = "wp-default") {
if (!empty($_COOKIE["wpstyle"])) {
$style = $_COOKIE["wpstyle"];
}
else {
$style = $default;
}
echo $style;
}
and change your style tag to this:
<style type="text/css" media="screen" title="<?php wp_style_name(); ?>">
@import url( <?php wp_stylesheet(); ?> );
</style>
Script can be seen in action at my site.
I don't understand why the styleswitcher doesn't work with the new installation of wordpress. I had styleswitcher in 2 blogs and they both work.
Error message is this
@import url(
Fatal error: Call to undefined function: wp_stylesheet() in /home/protag/public_html/nimrodel/indexwp.php on line 18
line 18 is
@import url( <?php wp_stylesheet(); ?> );
@Lauren:
1) Did you add the hack to the my-hacks.php file?
2) Did you turn on the my-hacks option in the admin area?
TG
Ahhhh I forgot to turn it on. No wonder. Thanks.
Is the css comp still running? I thought it had closed.
The competition is over, but I'm still adding style submissions to the site as they come in.
The golf demo site doesn't work for me w/ ie 6. Works under firefox, though. Definitely not as slick as the sites that use the builtin facilities for css switching (the little toolbar thingy in the corner), though (http://year.sniper8.com/archives/000006.php / http://www.movablestyle.com).
well you can always use css switcher using the browser tools (available in firefox and opera) or use this method!
http://www.alistapart.com/articles/alternate/
ok... i'm just now learning css and a php novice, so this may be a simple question.
i would like a main index page that is not a part of the wordpress package. on it i want to put 4 images, each one a link to a different wordpress style. is there a way to pass the cookie from a non-wp page to the wp index.php?
Well.. It doesn't work for me... I've done everything as readme tells to do, but when I click on the styles (getting a url with the index.php?wpstyle=XXXX), it simply keeps the default one. What can I been doing wrong? :(
Check your cookies. Make sure you've allowed cookies to be on.
Also, does the page refresh? It should refresh (should be near invisible) but the ?wpstyle=xxxxx should go away.
TG
Finally have a tutorial page for SD. You can find it here. I have also added a few tutorials from the hosting site...this way they are in one place.
I installed this hack and it works fine on my site. However when I try logging into the admin area of WP I get the following - any ideas why?:
Warning: Cannot modify header information - headers already sent by (output started at /home/ail/public_html/wp/my-hacks.php:4) in /home/ail/public_html/wp/wp-login.php on line 254
Warning: Cannot modify header information - headers already sent by (output started at /home/ail/public_html/wp/my-hacks.php:4) in /home/ail/public_html/wp/wp-login.php on line 255
Warning: Cannot modify header information - headers already sent by (output started at /home/ail/public_html/wp/my-hacks.php:4) in /home/ail/public_html/wp/wp-login.php on line 256
Warning: Cannot modify header information - headers already sent by (output started at /home/ail/public_html/wp/my-hacks.php:4) in /home/ail/public_html/wp/wp-login.php on line 257
Warning: Cannot modify header information - headers already sent by (output started at /home/ail/public_html/wp/my-hacks.php:4) in /home/ail/public_html/wp/wp-login.php on line 258
southerngal, I've already followed your tutorial, and I've double cheched each step, but it simply doesnt change styles...
TechGnome may have found the bug (or whatever): the ?wpstyle=xxxxx doesn't go away. The page doesn't refresh. When I refresht it by hand, however, it keeps the default style...
Cookies are on. I can change styles in several pages. Also, it doesn't work in any of my browsers...
Chuckie: I'm running WP locally. I was having exactly the same problem of you (and the other Anonymous). I solved it by using 127.0.0.1 instead of localhost on Web address (URI) option under Admin/General Options. Hope it helps.
I believe what you are refering to is Admin > Options > Base Settings > siteurl .. in my case I can't change that because I am on a shared host.
Thanks for trying,
Chuck
This topic has been closed to new replies.