Forums

Aaaarrrgh... wp-style-switcher plugin (43 posts)

  1. Volponi
    Member
    Posted 7 years ago #

    OK, so I'm almost a complete newbie to PHP. I'm sure that this problem has been asked an answered here many times. I tried searching for it repeatedly, and nothing seems to be working for me though. Perhaps I'm just too daft to understand the answer, if it was there.
    Scenario is this:
    I installed WP 1.2 yesterday. It was not installed in the server root, but in /journal/
    Everything seemed to work well. I played with some minor customizations of the default template, and managed to not screw things up (at least, I don't think so, it all seemed to be working OK).
    Then I tried to install Alex Jone's wp-styleswitcher, and I downloaded a ton of his sample styles to test out, but I just can't seem to get it to work.
    The styles are located in their individual folders, under /journal/wp-style
    The wp-style-switcher.php file is located in /journal/wp-content/plugins
    When I make the mod in /lournal/index.php, I can get a list of the styles, but none of them will load.
    I found several posts where a user called 'Beel' had suggested some alterations, although it sounded like there might be a slight difference in what the others were trying to do. It seemed that others were running WP from somewhere outside of public-html (which is probably a good idea, but I'm not at that level... Face it, I can't even make the thing work as it is...). Either way, I couldn't get any of it to work.
    Eventually, I restored the original wp-style-switcher.php file and put index.php bach the way it had been regarding styles.
    Any help would be greatly appreciated.


  2. Moderator
    Posted 7 years ago #

    A url would be handy :)

  3. Volponi
    Member
    Posted 7 years ago #

    Ah, yeah... Stupid me... Although, I should point out something I didn't notice until just now.
    The URL for my test/play-around/try-to-learn installation is:
    http://s94939858.onlinehome.us/journal/
    Currently, the changes to the 'index.php' file have been restored to static (slightly modified) .css file, but the links to the alternate styles are still shown toward the bottom of the page on the right.
    The thing I recently noticed (which might or might not be worth pointing out), is that the example on Alex's 'golf' page seems to view well under firefox, but not under MSIE. Probably a huge oversight on my part, but my MSIE cookies were disabled. Still, even after enabling them, it seems to make no difference on my site, although it works on Alex's 'golf' site just fine.
    Thanks again to anyone who can straighten me out.... I'm sure it's probably something stupid on my part....

  4. Volponi
    Member
    Posted 7 years ago #

    Yes, I made a few changes to the file:
    /journal/index.php
    purely for the purposes of altering the layout slightly (mainly the order of the items on the right-hand side, under the "menu" section), and I made a few changes to the default stylesheet (before I installed - or even knew about - the style-switcher), to change the default colors and such) - Other than that, it's a straight install...
    I did (a couple of times) back up my current files, replace the changed files with those from the distro, and retry the changes... If I understand corrctly, replacing these files (and then following the instructions in the wp-style-switcher README) should create a relatively foolproof test-install:
    /journal/index.php
    /journal/wp-layout.css
    /journal/wp-content/plugins/wp-style-switcher.php
    No joy. I'm convinced that this must be a really stupid oversight on my part... Gotta be something obvious that I've overlooked... I have a natural talent for missing the simplest things.
    Again, I'm tremendously thankful for any and all advice.


  5. Moderator
    Posted 7 years ago #

    I am not sure Volponi...
    It looks like everything is ok in your files. You have activated your style switcher in the plugins?
    I know it sounds like a silly question but don't worry, you wouldn't be the first to make this simple mistake.
    Failing that, I will have to leave it in the hands of the gurus here. Let us know how you get on though... and do check to make sure your plugin is activated.

  6. Volponi
    Member
    Posted 7 years ago #

    Yeah, it's activated... And no question is too silly as far as I'm concerned... I'm not really sure if I should've posted this in the troubleshooting forum rather than the plugin forum... I do have a tendency to overlook things that should be obvious...
    I keep coming back to the idea that I must've hosed up my /journal/index.php file while I was re-arranging the placement of the things in the #menu section... That seems like the obvious place I could've screwed something up... Although after having restored the index.php and other files, clearing cache, deleting cookies, etc, with no positive results, I'mleft with the feeling that I must've done something really boneheaded in order to still be non-functional....
    Oh well, at least it was a fresh install... I'll play with it for a day or so, then I'll delete it all and try a fresh re-install if I don't get any better ideas.... Nothing to lose, anyhow, and plenty to gain in the way of a learning experience (assuming I can figure out where I screwed up in the first place)... We all tend to learn more from our mistakes than from our success...
    Even so, if anyone is able to spot my (probably obvious) errors before I go 'tabula rasa', please feel free to make suggestions, criticism, or whatever.... Anything short of direct flames might be helpful...
    Thanks again, in advance

  7. planetphillip
    Member
    Posted 7 years ago #

    This is from the Read me:
    Include the stylesheet in your index.php file.
    Find this line near the top of index.php:
    @import url( <?php echo $siteurl; ?>/wp-layout.css );
    And change it to:
    @import url( <?php wp_stylesheet(); ?> );
    Note: you can pass in the name of the style you want to use as the default like this:
    @import url( <?php wp_stylesheet("my-new-style"); ?> );
    Did you try this?

  8. Mark (podz)
    Support Maven
    Posted 7 years ago #

    Have you looked inside the plugin itself ?
    wp-style-switcher.php
    This line is in there:
    // change this to the name of default style you want to use
    $wp_style_default = 'wp-default';
    Try changing that ?

  9. Volponi
    Member
    Posted 7 years ago #

    Looks like I got it working... As I suspected, it was my idiocy... I didn't realize that it was taboo to have anything commented out inside the "<style> ... </style>" block... I did have a comment line in there, and apparently the entire block was being ignored.
    Now to play with the different styles available, and modify the layout/etc...
    Thanks to all for the suggestions.

  10. Puerilis
    Member
    Posted 7 years ago #

    Hi Folks,
    I've got exactly the same problem as Volponi, I also made the change that podz mentioned,
    i changed $wp_style_default = 'wp-default'; to $wp_style_default = 'blue'; and i can see the blue style, but still when i click on one of the other styles the page reloads with the same blue style.
    I have read all the other posts with regards to cookies and localhost installs, but nothing seems to fix it,
    i have even downloaded alex king's "wp_1.2_pluggedin" which is WP1.2 and all the plug-in's already linked in but that does not work.
    I have the WP installation on the root of the webserver, the wp-style is a subfolder of the root.
    I have tried accessing the server from another pc but still the styles don't change.
    I can't post the url of the server as its not on live internet connection at the moment.
    any idea's,
    cheers
    Puerilis

  11. Mark (podz)
    Support Maven
    Posted 7 years ago #

    View Source and check paths ?
    Also hover the style links and check the path there too. ?

  12. Mark (podz)
    Support Maven
    Posted 7 years ago #

    The js error is related to the slvShowNewIndicator not being defined.
    Still looking :)

  13. Mark (podz)
    Support Maven
    Posted 7 years ago #

    Well the CSS is in the correct place ....
    What is the actual code in index.php that covers this part ?
    <style type="text/css" media="screen">
    @import url(http://home.puerilis.co.uk/wordpress/wp-style/wp-default/style.css);
    </style>

  14. Puerilis
    Member
    Posted 7 years ago #

    <style type="text/css" media="screen">
    @import url(<?php wp_stylesheet(); ?>);
    </style>
    the code was all tweaked by alex king :o)

  15. Mark (podz)
    Support Maven
    Posted 7 years ago #

    Very odd .... have you got a server error log ? That would show if any odd errors were occurring.

  16. Anonymous
    Unregistered
    Posted 7 years ago #

    only the standard IIS logs
    Oh hang on "/wordpress/wp-style/wp-default/images/content-background.gif 404 "
    404 is file not found, i just checked the directory and the "wp_1.2_pluggedin" zip file and there isn't a "content-background.gif " in the directory and non in the zip file, but apart from that, there are no other errors.

  17. Mark (podz)
    Support Maven
    Posted 7 years ago #

    In the plugin file itself is this line:
    change this to the name of default style you want to use
    $wp_style_default = 'wp-default';//
    Try changing that to golf ? or blue-fade ?
    Just need to check that another stylesheet can be picked up.

  18. Puerilis
    Member
    Posted 7 years ago #

    Just changed it to
    // change this to the name of default style you want to use
    $wp_style_default = 'golf';
    I've refreshed the page, no change in the style.

  19. Mark (podz)
    Support Maven
    Posted 7 years ago #

    Something *is* wrong somewhere ........
    Lets try this - grab a stylesheet directly.
    In index.php, whete you have that style call, cut and delete it (it;'s copied here above to put back), and paste this there instead:
    <style type="text/css" media="screen">
    @import url(http://home.puerilis.co.uk/wordpress/wp-style/blue/style.css);
    </style>

    See if this works ...

  20. Puerilis
    Member
    Posted 7 years ago #

    Done, and is working, I can see blue.
    BTW i have msn messenger if its easier to chat

  21. Mark (podz)
    Support Maven
    Posted 7 years ago #

    Okay ...
    css paths are cool
    css can be picked up with a direct call
    plugin is sending no errors so we assume it's okay too..
    It's a local install.
    When the styleswitcher kicks in, it does by using an addition to the url (POST method ?) - could your server setup be stripping that information ?

  22. Mark (podz)
    Support Maven
    Posted 7 years ago #

    On that issue I'm afraid I have not the slightest clue .... that's beyond my knowledge and experience. Worth a bash for a few minutes to test though ?
    You'll need to replace the style stuff.

  23. Puerilis
    Member
    Posted 7 years ago #

    you said earlier
    "The js error is related to the slvShowNewIndicator not being defined."
    hows do i fix that ?

  24. Mark (podz)
    Support Maven
    Posted 7 years ago #

    Have you got this in the <head> anywhere ?
    <?php $wplastvisit_output = "javascript"; require('wp-content/plugins/wp-last-visit.php'); ?>

  25. Mark (podz)
    Support Maven
    Posted 7 years ago #

    And with the styleswitcher - it brings up default again.
    What I *think* may be happening is that the script is actually calling the correct stylesheet, but that somewhere - and I've no clue where - the default is again being called.
    I'm at a bit of a loss now I'm afraid.

  26. Puerilis
    Member
    Posted 7 years ago #

    yeah i've stripped it out but it still errors

  27. Anonymous
    Unregistered
    Posted 7 years ago #

    I think I'm having a similar problem.
    I've finished upgrading to 1.2, and have installed the style switcher and followed the readme, etc etc. However, I'm having a hard time figuring out exactly why my styles are not switching.
    Url: http://cafe-jazz.net/court/

  28. Puerilis
    Member
    Posted 7 years ago #

    Hi le_honey
    We've all had the same problem, the codes are in the right places and the files are in the right folders but it still doesn't work, personally i've given up on it as when i checked alex king's (the style switcher creator) website, it didn't even look like he was using his own style switcher on his site.
    I have also downloaded and installed the "wp_1.2_pluggedin" which is wordpress 1.2 with all the plugin's installed and that doesn'r work either, i have tried reinstalling this style switcher on Apache and on other IIS servers and still i can't get it to work, i think that we are all better off using another style switcher.

  29. Beel
    Member
    Posted 7 years ago #

    Honey, the source of your page has this:
    <style type="text/css" media="screen">
    @import url( http://cafe-jazz.net/court/wp-layout.css );
    </style>
    Did you replace it in the file with this?:
    <style type="text/css" media="screen">
    @import url( <?php wp_stylesheet(); ?> );
    </style>

  30. TechGnome
    Moderator
    Posted 7 years ago #

    The problem, I think is Windows somehow. I have never been able to get it to work on a Windows box (running Apahe) running as localhost or 127.0.0.1 (this is my local machine I try to use for testing). For some reason, the cookie that holds the style to switch to doesn't get set, so it continues to use the default one.
    But when I uploaded to my main server (which happens to be a Linux running Apache) then it worked fine and the cookie gets set and the style changes. I have never been able to trace what the problem is, or how to fix it. People at PHP.net seemed to think that using 127.0.0.1 was the answer (the key was that the domain address contain at least 1 dot in it) but it wasn't.
    I don't know if any of this is any help, but I thought I'd share my experience because, I have been there.
    TG

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.