WordPress.org

Support

Support » Installation » are there any ways to change position of “Current Mode”?

are there any ways to change position of “Current Mode”?

  • The moody plugin adds a current mood after the entry’s day and i wonder if there’s a way to change the current mood to the end of the entry? Or if I should paste certain part of the following code to my Main Template? Advices are appreciated and thanks.


    <?php
    /*
    Plugin Name: Moody
    Plugin URI: http://www.gudlyf.com/index.php?p=365
    Description: Adds a "Current Mood" icon to each post after the date. Borrowed icons from http://www.wholenotherthing.com/ which can be grabbed from http://www.gudlyf.com/media/moods.zip. Unzip moods into wp-content/plugins/moods and activate plugin. Add Custom field "mood" to posts to use one of the icons (posts with no mood show a default icon).
    Version: 1.1
    Author: Keith McDuffee
    Author URI: http://www.gudlyf.com/
    */

    function moody($original) {

    $mood_icon_dir = $curpath . "/wp-content/plugins/moods/";
    $mood_icon_ext = '.gif';

    $values = get_post_custom_values('mood');
    $mood = $values[0];

    /* Print original text first */
    print $original;

    if(!empty($mood)) {

    print ' ';
    print '(Current Mood: ';
    print '<img src="' . get_settings('siteurl') . $mood_icon_dir . $mood . $mood_icon_ext . '" alt="' . $mood . '" title="' . $mood . '" />)';
    }
    }

    add_filter('the_time', 'moody');

    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • perhaps i didn’t make it clear, shall i add something like
    <?php get_post_custom_values(‘mood’) ; ?>

    to the specific place i want in the main template?

    Probably just change the following line…

    add_filter('the_time', 'moody');

    ..to this one…

    add_filter('the_content', 'moody');

    Beware, “the sky might fall on your head.”

    thanks, alpha, it works successfully, how silly i’m not to notice the small code! thanks 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘are there any ways to change position of “Current Mode”?’ is closed to new replies.