Tricky WP Custom Post Type Question

Discussion in 'WordPress' started by Matt Jo, May 29, 2011.

  1. #1
    Hey

    I got a tricky question about the Custom Post feature in Wordpress. Let's say I have a post already and the URL is wegotthiscovered.com/movies/avatar-review

    Now let's say I create a custom post type a few days later called Film Reviews and I change the post type of the Avatar review to a film review. When I do that, the URL also changes to wegotthiscovered.com/film-review/avatar-review and when I try to view it, it gives me a 404.

    Is there anyway to switch a posts' post type without changing the URL?
     
    Matt Jo, May 29, 2011 IP
  2. kajol

    kajol Well-Known Member

    Messages:
    523
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Post Type..?... are you talking about wordpress category?... you can define your won URL slug... no need to change whenever you update the category of the post.
     
    kajol, May 30, 2011 IP
  3. Matt Jo

    Matt Jo Member

    Messages:
    155
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    Ok, I'm having another issue. The custom post type is created but not showing up in the Admin Dashboard of Wordpress. I know it's created properly because I'm able to switch a post type to the custom post type but there is no section for it in the dashboar
     
    Matt Jo, May 30, 2011 IP
  4. rakesh kumar

    rakesh kumar Active Member

    Messages:
    393
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #4
    This you can achieve firing a simple sql query on it's database

    update table name set col_name =replace(original column, oldvalue, new value)

    This is the exact sql query for you. Do not forget to take backup of your database before firing this query

    update wp_posts set post_content= replace(post_content,’http://oldsitename.com’,’http://newsitename.com’)
     
    rakesh kumar, May 30, 2011 IP
  5. bekar09

    bekar09 Active Member

    Messages:
    283
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    70
    #5
    I would strong suggest not to run this query, since wp_posts table has got a relation with wp_terms and wp_term_taxonomies.

    I think that the Redirect plugin should solve your problem. just try out once and report back.

    Thank.
     
    bekar09, May 31, 2011 IP