English 中文(简体)
Move D. 新闻职位和与习俗类型和分类相关的分类
原标题:Move WordPress posts and related taxonomy to custom post type & taxonomy

I have a clean WordPress installation using Twenty Eleven, with no plugins or other modifications. The blog contains approximately 800 posts with related tags and categories.

我愿将所有这些职位调往习俗员额。 通过在我的职能中增加以下法典。 现在,我的博客已经安装并完美地工作。

//Add custom post type
add_action(  init ,  create_en_post_type  );
    function create_en_post_type() {
        register_post_type(  en_post ,  array(
             labels  => array(
                 name  => __(  English Posts  ),
                 singular_name  => __(  English Post  )
            ),
             public  => true,
             menu_position  => 5,
             rewrite  => array( slug  =>  en ),
             supports  => array(
                 title , 
                 editor , 
                 author , 
                 excerpt , 
                 comments , 
                 custom-fields 
            )
        ));
    }

//Add belonging custom taxonomy
add_action(  init ,  build_taxonomies , 0 ); 
    function build_taxonomies() { 
    register_taxonomy(  english_categories ,  en_post , array(  hierarchical  => true,  label  =>  English Categories ,  query_var  => true,  rewrite  => true ) );
    register_taxonomy(  english_tags ,  en_post , array(  hierarchical  => false,  label  =>  English Tags ,  query_var  => true,  rewrite  => true ) );
    }

现在,我都需要将固定员额类型改为我的习惯员额类型。 我已设法利用Plugin Convert Post打字,但我的纳税人已经转换。

我认识到,我只能创建类似的习俗类别,并将习俗员额分配给它们,但究竟是谁? 我如何转换这些标签(自动点数为1 200tag)?

我在数据库中进行了人工阅读,但我可以这样做。

最佳回答

你们应当改变数据库中的身份证号码,长期看看看管Sphpmyadmin。

  • wp_term_taxonomy
  • wp_terms
  • wp_term_relationships

In the terms table you will find the id of the old and new taxamonies
in term_taxonomy replace all old term_id with the new.

文件:

UPDATE `wp_term_relationships` SET `term_id` = REPLACE(`term_id`, /*old id*/, /*new id*/);

页: 1 页: 1

问题回答

暂无回答




相关问题
Wrap stray text in <p> tags

Wordpress issue.. how do I wrap stray text in P tags? Example: Before- <div class = "content"> <img src = "hello.jpg"/> <h1>Introduction</h1> Hello! this is ...

Using jQuery Plugins with Wordpress

Having a bit of trouble using jQuery plugins (Superfish, jQuery UI, etc) using Wordpress. Everything works fine in my plain non-Wordpress site, but Wordpress seems to conflict with JQuery. There must ...

WordPress Data Storage Efficiency

I ve been asked to review a WordPress plugin of sorts and try to find ways of making it faster. The premise of this plugin is basically to store a bunch of users and shifts and appointments and ...

Why can t I properly style a blockquote in Wordpress?

On the design I just created for my website, I have a blockquote styled with two quote images using the span technique in css: blockquote { background-image: url(images/openquote.jpg); background-...

How does the WordPress <!--nextpage--> tag actually work?

What happens? I m guessing that somehow the post or page is parsed before displaying, and then just split into two methods? I can t seem to find any documentation on how the underlying <?php ...

Wordpress Plug-ins: How-to add custom URL Handles

I m trying to write a Wordpress Plug-in but can t seem to figure out how you would modify how a URL gets handled, so for example: any requests made for: <url>/?myplugin=<pageID> will ...

热门标签