WordPress.org

Ready to get started?Download WordPress

Forums

are there any ways to change position of "Current Mode"? (4 posts)

  1. stchatterbox
    Member
    Posted 9 years ago #

    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');

    ?>

  2. stchatterbox
    Member
    Posted 9 years ago #

    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?

  3. Joshua Sigar
    Member
    Posted 9 years ago #

    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."

  4. stchatterbox
    Member
    Posted 9 years ago #

    thanks, alpha, it works successfully, how silly i'm not to notice the small code! thanks :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.