Results 1 to 2 of 2

Thread: Titles to Tags Modification

  1. #1
    Thread Starter
    rovielran's Avatar
    Join Date
    Nov 2010
    Location
    Singapore
    Posts
    2
    Thanks
    0
    Thanked 5 Times in 1 Post

    Cool Titles to Tags Modification

    I found this plugin that converts title to tag http://wordpress.org/extend/plugins/title-to-tags/ although it doesn't work on classipress it could be nice if someone can make this work for it has some stop word functions.,

    i think the modding is particularly on this section
    Code:
    class titleToTags {	
    	
    	// Convert titles to tags on save:
    	function convert($post_id) {
    		$post	= get_post(wp_is_post_revision($post_id));
    		// No title? No point in going any further:
    		if(isset($post->post_title)) :
    			$title	= $post->post_title;
    			// Only run if there are not already tags assigned to the post:
    			if(!wp_get_post_tags($post_id)) :
    				// Setup our tag data:
    				$title_to_tags	= array();
    				$stopwords		= $this->getStopWords();
    				$title_werdz	= explode(' ', $title);
    				foreach ($title_werdz as $werd) :
    					$werd = $this->lowerNoPunc($werd);
    					if(!in_array($werd, $stopwords) && !in_array($werd, $this->wp_stop)) :
    						$title_to_tags[] = $werd;
    					endif;
    				endforeach;
    				// Finally, add the tags to the post
    				wp_add_post_tags($post_id, $title_to_tags);
    			endif;
    		endif;
    	}

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,748
    Thanks
    166
    Thanked 3,390 Times in 3,261 Posts
    I think it can be done by adding the post_type parameter in get_post function argument. I still have to check the codes further though.
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. SEO: Meta Tags - Titles, Descriptions, etc.
    By panopticholdings in forum Clipper General Discussion
    Replies: 1
    Last Post: October 16th, 2011, 12:33 AM
  2. Can Google Read Ad Titles?
    By decquinn in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: June 23rd, 2011, 02:35 PM
  3. [SOLVED] Tag Cloud still not showing AD Tags after Modification... Please Help!
    By socram10 in forum Report ClassiPress Bugs
    Replies: 7
    Last Post: December 9th, 2010, 09:36 AM
  4. Post titles in Hebrew
    By yoramzara in forum ClassiPress General Discussion
    Replies: 1
    Last Post: September 10th, 2010, 04:30 PM