Forums

Changing smilies with themes. (10 posts)

  1. Lan
    Member
    Posted 3 years ago #

    Is it possible to make it so that a different set of smilies goes with a different theme. So that if i had a blue layout, i could get blue smilies to go with it. but if a visitor wanted to change to a green theme, the smilies i chose for the green theme would work.

  2. podz
    Support Maven
    Posted 3 years ago #

    Neat idea ...
    Smilies are controlled in vars.php though, so the only way I can think you could do that would be to create a different vars.php per theme and upload each as wanted.
    Or maybe a plugin author would know different ?

  3. ImTa2d
    Member
    Posted 3 years ago #

    I am also looking for a way to change the smilies with each theme... I played with the vars file, but obviously no luck. Here's what i attempted.

    $wp_smiliesreplace[] = " <img src='" . bloginfo('styleheet_directory') . "/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> ";

    Anyone find a way to do this or see something that's wrong with my code?

  4. Tishi
    Member
    Posted 3 years ago #

    I've been wondering the same thing. I've tried putting a vars.php in to no avail, and I used the bloginfo('stylesheet_directory') include in vars.php and it still didn't like it. Anyone else got ideas?

  5. Viper007Bond
    Member
    Posted 3 years ago #

    If you can't find a way to easily do it by editing vars.php, it shouldn't be hard to throw together a plugin that loads up a different smilies var depending on the theme being used.

    if ($theme == 'foo') $smilies = [...];
    elseif ($theme == 'bar') $smilies = [...];

    I'm willing to do it if no one else wants to. :)

  6. Tishi
    Member
    Posted 3 years ago #

    Is there actually a way you can call the name of the current theme that's in use?
    It would be great if you could, Viper007Bond -grin- I certainly don't have the knowledge to do something like this.

  7. Viper007Bond
    Member
    Posted 3 years ago #

    Is there actually a way you can call the name of the current theme that's in use?

    Well, it's not hard to get what the default theme is. You just use get_option('template') to grab the folder name of the current theme.

    However, if you're using the theme switcher, it has to be pulled from the user's cookie as it varies from user to user.

    I'll get to work on it. :)

  8. Viper007Bond
    Member
    Posted 3 years ago #

    Here 'ya go: http://www.viper007bond.com/wordpress-plugins/smilies-switcher/

    Lemme know if you encounter any problems with it. :)

  9. Tishi
    Member
    Posted 3 years ago #

    You are a SAINT.
    It seems to be working fine =D Thank-you! Plus, if you don't have a smilies.php in your theme folder, it defaults to the ones specified in vars.php! xD
    You will be definately getting a plug next time I blog :D

  10. Viper007Bond
    Member
    Posted 3 years ago #

    Haha, glad to help. :)

    However, your realize your smilies are 404 on your spring kitten theme, right?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags