【问题标题】:WPML is not detecting Wordpress custom post typesWPML 未检测到 Wordpress 自定义帖子类型
【发布时间】:2023-03-22 09:02:01
【问题描述】:

我通过以下教程学习了如何制作自定义帖子类型:

http://sixrevisions.com/wordpress/wordpress-custom-post-types-guide/

基本上就是将这段代码添加到function.php

add_action( 'init', 'create_events' );
function create_events() {
  $labels = array(
    'name' => _x('Events', 'post type general name'),
    'singular_name' => _x('Event', 'post type singular name'),
    'add_new' => _x('Add New', 'Event'),
    'add_new_item' => __('Add New Event'),
    'edit_item' => __('Edit Event'),
    'new_item' => __('New Event'),
    'view_item' => __('View Event'),
    'search_items' => __('Search Events'),
    'not_found' =>  __('No Events found'),
    'not_found_in_trash' => __('No Events found in Trash'),
    'parent_item_colon' => ''
  );

  $supports = array('title', 'editor', 'custom-fields', 'revisions', 'excerpt');

  register_post_type( 'event',
    array(
      'labels' => $labels,
      'public' => true,
      'supports' => $supports
    )
  );
}

WPML 插件可帮助您将帖子翻译成不同的语言。但此选项不会出现在自定义帖子类型中。

有什么建议吗?

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    点击 WPML->多语言内容设置并选择让这些自定义类型可翻译。

    您的管理仪表板中还有一条通知说您没有选择是否要翻译该自定义类型。

    【讨论】:

      猜你喜欢
      • 2016-12-04
      • 2014-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-14
      相关资源
      最近更新 更多