WordPress has a nice feature called Custom Post types.
(An overview for those that code for WordPress is here - http://wp.tutsplus.com/tutorials/plugins/a-guide-to-wordpress-custom-post-types-creation-display-and-meta-boxes/ )
We typically use the Custom Post Types UI plugin ( http://wordpress.org/extend/plugins/custom-post-type-ui/ ) to create, rather than write code. The end result is the same though.
This allows us to create specifically enumerated sets of content relatively easily.
eg – if you were doing a Site for a Client, you may need a Portfolio section for their web.
With custom post types, you can setup a Portfolio post type, and add various taxonomies (meta data to group or organize these posts by later)
eg Category
Eg if it was for a web design firm, you might add values into the Category taxonomy like
Flash
HTML5
CMS
Then choose those categories when you add a new Portfolio post so that you can later filter by any of those fields.
So far so good.
We also use another Plugin called QTranslate ( http://www.qianqin.de/qtranslate/ )
QTranslate allows us to add multiple translations for a post, or taxonomy in the WordPress UI.
Its pretty nifty, and a good tool for those that do multilingual wordpress sites.
QTranslate seems to be a little funky about how it works with Custom Post Types though – essentially its a little hit and miss whether it actually populates the backend with translation options.
After a bit of googling I found a nice solution to force it to parse taxonomies.
Add this into your Template functions.php at the end of the file, and QTranslate will work properly.
function qtranslate_edit_taxonomies(){
$args=array(
'public' => true ,
'_builtin' => false
);
$output = 'object'; // or objects
$operator = 'and'; // 'and' or 'or'
$taxonomies = get_taxonomies($args,$output,$operator);
if ($taxonomies) {
foreach ($taxonomies as $taxonomy ) {
add_action( $taxonomy->name.'_add_form', 'qtrans_modifyTermFormFor');
add_action( $taxonomy->name.'_edit_form', 'qtrans_modifyTermFormFor');
}
}
}
add_action('admin_init', 'qtranslate_edit_taxonomies');
4 Comments to “Custom Taxonomies in WordPress and QTranslate translation (problem / resolution)”
Post comment
Archives
- May 2013
- April 2013
- March 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- December 2011
- November 2011
- October 2011
- September 2011
- July 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
Categories
- Apple
- Arcade Machines
- Badges
- BMW
- China Related
- Cool Hunting
- Exploits
- Firmware
- Food
- General Talk
- government
- IP Cam
- iPhone
- Lasers
- legislation
- MODx
- MySQL
- qmail
- requirements
- Reviews
- Service Issues
- Tao Bao
- Technical Mumbo Jumbo
- Things that will get me censored
- Travel
- Uncategorized
- Useful Info
Most Popular Posts
- IPCam Hacking - pt#2 (17464)
- 138 in 1 Jamma PCB with SD Card (XinYe Arm Jamma Board) - Quick file system firmware reversing engineering notes (10919)
- JZ4755 Jamma Board Reverse Engineering Part 3 (King of Game Board) (7845)
- Samsung N310 (Samsung Go) Hackintosh Installation on Snow Leopard (6264)
- BMW Keys and Transponders E36 E38 E46 etc (EWS2) (3298)
Tags
Recent Comments
-
Olivier: Hello Franky, I have checked last week in the Ducati store in Shanghai, a streefighter 848 is 240kRMB and...
-
Lawrence Sheed: Not sure, but the bike plate will be in the 70-80,000RMB range at the moment before you even look...
-
Franky: Hello, Actually i am riding a ducati Mts 1200 in Singapore. We are thinking to relocate to Shanghai. I own...
-
juna: Please can you tell me what is wrong with my cam? it keeps rebooting over and over, this is it reconnects for...
-
Maseehullah: hi. i am wondring if any one knows how to get a motercycle licence in Jinan.
Recent Trackbacks
- Large: Checking the Watermark: Review of Shenhua’s Watermark coal project economic assessment | Economists
- Monitoring servers with an USB lamp: Laurence Sheed uses the eBuddy for server load and door entry monitoring .
- Branik's Blog: Bing Is A Nuisance
- Computer Solutions Blog: sysfence updates for debian (startup script, and makefile fix)
- eFront Blog: 5 things you (perhaps) don’t know about eFront






















Hello!
it Works!!
thank you very much!!!
Wow! Thanks!
But there’s an issue: when you open an article and go to write a value in the custom taxonomy, the field in the autocomplete dropdown doesn’t show nothing but a ’0′ (zero).
Are you able to fix this?
Works fine, thank you very much
Do you know how can i translate the name of the custom taxonomy.
register_taxonomy(‘language’,'poems’,array(
‘hierarchical’ => true,
‘label’ => ‘Language’,
‘show_ui’ => true,
‘query_var’ => true,
‘rewrite’ => array(‘slug’ => ‘language’ )
));
Just to be clear, I want to translate Lanugage into Јазик .