WordPress.org

Forums

Post Title Color
[resolved] Title colour affecting menu titles (2 posts)

  1. sammuello
    Member
    Posted 3 years ago #

    Very handy plugin - thanks!

    Just noticed a slight niggle though, in that the colouring can affect menu items. To get around this, I added an extra condition testing for in_the_loop() in the add_to_title function in the plugin as follows:

    function add_to_title( $title ) {
    		global $post;
    		if (get_post_meta($post->ID, 'title_color', true) && in_the_loop() )
    			return '<span style="color:' . get_post_meta($post->ID, 'title_color', true) . ';">' . $title . '</span>';
    		else
    			return $title;
    	}

    Hope that helps someone.

    http://wordpress.org/extend/plugins/post-title-colors/

  2. treysea
    Member
    Posted 2 years ago #

    thanks! that was very helpful.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Post Title Color
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic