WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] Tag archive link not found (8 posts)

  1. Foreverbarcelona
    Member
    Posted 10 months ago #

    Hello!

    Thank you for your plugin, it saved me a lot of time when I changed theme and some subfolders seemed to disappear...

    However, I have noticed that when I try to visualize the archives for the entries with a tag, I get a Not Found page. Here is an exemple:
    http://www.foreverbarcelona.com/tag/pf-gaudi/

    It only happens with the custom type posts (the tags for non-custom posts do appear)

    Any idea on how to solve it will be appreciated. Thanks a lot!

    http://wordpress.org/plugins/custom-post-type-ui/

  2. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Hopefully you've figured out the issue since you first posted this. However, if not, I'll do what I can.

    I assume you've added tag support for your newly registered Custom Post Type, via the "advanced options" link.

    I also assume you've created some posts with some tags as well.

    A quick search has my initial hunch looking correct. Out of the box, WordPress apparently doesn't add new post types to category and tag archive listings.

    Here's an article with a quick tutorial on how to change this, and get post types in those archives.

    http://wpmu.org/add-custom-post-types-to-tags-and-categories-in-wordpress/

    It's a small snippet and I've verified it's good code, so it will be safe to use.

    Let me know if that helps get this resolved for you. I'll probably add it to the plugin FAQs for future reference as well.

  3. Foreverbarcelona
    Member
    Posted 10 months ago #

    Hi Michael,

    Thank you for your quick reply!
    I did find a post where you mentioned the Advanced Options link, unfortunately, I was not able to find it anywhere. If you could show me how to find it, that would be soooo helpful.
    Thanks again,

    Marta

  4. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    It's part of our CPTUI Plugin, and right below the 3 fields you use to create the CPT slug and name and description. However, I think the link above will be very helpful as well if you haven't looked at it yet. Worst case, I could type up the exact code you need to save to your functions.php, if you're not comfortable with code.

  5. Foreverbarcelona
    Member
    Posted 10 months ago #

    Hi Michael!

    Thank you so much! Looks like I had already checked the tag and category support. So I went and tried the code you suggested. I here is what I copied on the file:

    function add_custom_types_to_tax( $query ) {
    if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
    
    // Get all your post types
    
    $post_types = array( 'post', 'bl_portfolio' );
    
    $query->set( 'post_type', $post_types );
    return $query;
    }
    }
    add_filter( 'pre_get_posts', 'add_custom_types_to_tax' );

    And now the archives show up but... at the bottom of the page should appear a list of my services, and something is messing up here because (only for the archive page), instead of services I get my latest blog posts... Any idea how can I solve it?

    Thanks a lot for your patience!

    Marta

  6. Foreverbarcelona
    Member
    Posted 10 months ago #

    By the way, here is a link with the broken services:
    http://www.foreverbarcelona.com/tag/pf-gaudi/

    And here is a link with the services as they should look like:
    http://www.foreverbarcelona.com/bl_portfolio/center/

    Thanks!

  7. Michael Beckwith
    Member
    Plugin Author

    Posted 10 months ago #

    Curious if your Related Posts Slider doesn't know about your custom post type. However, that'd be an issue to bring up to that plugin author, it would seem. They should be able to help get it on your CPT archives.

  8. ptitepalou
    Member
    Posted 9 months ago #

    Oooh thank you so much !! I am searching for a solution for 3 4 hours !
    I do think I was not well searching .. wanted to show the custom post types in search results, but in fact it was a problem of tag and categories. So now I am going to style my search resultats page ^^ (archive)

    Thank you Michael & Foreverbarcelona !

Reply

You must log in to post.

About this Plugin

About this Topic