WordPress.org

Ready to get started?Download WordPress

Forums

Convert Post Types
[resolved] Converting post types broke taxonomy queries though still associated to (3 posts)

  1. Taylor Baybutt
    Member
    Posted 3 years ago #

    I used this plugin to bulk convert my post types when I upgraded more fields and added more types. After trial and error, restoring my database, I was able to retain all of the custom taxonomies (and it was a lot) associated with each post. This was fantastic, however...

    http://wordpress.org/extend/plugins/more-types/
    http://wordpress.org/extend/plugins/more-fields/

    In the backend and in the database all seems in order but when I try to query by a taxonomy (e.g. 'city' => 'boston') the query returns no results.

    It is really strange because I know the taxonomies are associated to the posts and I can call them in the theme but something is going very wrong when querying.

    This is the last step to me completing an upgrade to 3.0.1 from 2.9.2 so if any one has any insight, please, all is welcome.

    http://wordpress.org/extend/plugins/convert-post-types/

  2. Taylor Baybutt
    Member
    Posted 3 years ago #

    fully functioning site is online at http://writershouses.com which is on 3.0.1 without the above plugins all upgraded.

    and everything is definitely publicly queryable in the original upgrade test version.

    in a third test copy, when I use 'post type switcher' to convert the post types, everything works as expected and the taxonomies are retained and queryable. So I will be doing them one by one I guess!

    scratch that, when using post_type switcher, the same problem occurs.

    Is there some trick to querying a post_type and a custom taxonomy at the same time?

  3. Taylor Baybutt
    Member
    Posted 3 years ago #

    ok, in case anyone comes across this, you need to specifiy what post types you are querying otherwise it will just query the default post type. additionally, you need to specify that the post_status is 'publish'. to query all post types, you can do

    $post_types = get_post_types();

    and for the query argument

    post_type = $post_types

    that may not be entirely accurate but I am not going back into the code right now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic