WordPress.org

Ready to get started?Download WordPress

Forums

Titles to Tags
Fixed it! The Hack that Helped Me (2 posts)

  1. iftomkins
    Member
    Posted 2 years ago #

    The most recent version of the plugin didn't work for me, so here's the hacky solution I used to get it working:

    1. I started with the previous version of the plugin: 3.0.1, which I downloaded from the plugin page. This version worked for me, but the stopwords didn't.

    2. Then, I modified hn_title_to_tags.php. On lines 127 to 142, this was the old code:

    private function getStopWords() {
    		// Do we have stopwords in the db?
    		if($stopwords = get_option('hn_title_to_tags')) :
    			return $stopwords;
    		// If not, use the default list:
    		else :
    			$file 			= dirname(__FILE__).'/stopwords.txt';
    			$stopwords		= file_get_contents($file);
    			$verboten		= explode(',', $stopwords);
    			for($x = 0; $x < count($verboten); $x++) :
    				$verboten[$x]	= $this->lowerNoPunc($verboten[$x]);
    			endfor;
    			update_option('hn_title_to_tags', $verboten);
    			return $verboten;
    		endif;
    	}

    And I replaced it with this code:

    private function getStopWords() {
    		// Do we have stopwords in the db?
    			$file 			= dirname(__FILE__).'/stopwords.txt';
    			$stopwords		= file_get_contents($file);
    			$verboten		= explode(',', $stopwords);
    			for($x = 0; $x < count($verboten); $x++) :
    				$verboten[$x]	= $this->lowerNoPunc($verboten[$x]);
    			endfor;
    			update_option('hn_title_to_tags', $verboten);
    			return $verboten;
    	}

    That just took out the ability to add Stop Words from the settings area, since that wasn't working.

    3. I created a file called stopwords.text, and placed it in the title-to-tags plugin folder.

    4. I pasted all the default stopwords from the options panel into it. If I need to add new stopwords, I'll have to do it through this text file, but at least it's working!

    Hacky, but I love it.

    http://wordpress.org/extend/plugins/title-to-tags/

  2. 3x7
    Member
    Posted 2 years ago #

    Hi,

    since you know how it works, you might know how to achieve this:

    http://wordpress.org/support/topic/plugin-titles-to-tags-exclude-all-numerical-tags?replies=1#post-2859722

    thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic