• Resolved silversurfer

    (@alhemicar)


    Thanks for the great plugin, real time-saver!

    I have a “small” problem – the single.php page for displaying my custom post types is working great, but the archive.php does not. My post type is named “deal”, custom taxonomy is “deal_type”, the two template pages are named like

    single-deal.php
    archive-deal.php

    When I try to show all posts from the custom taxonomy, WP defaults to archive.php. Now, all of the settings in Types are set correctly, has_archive is checked, rewrite is checked, I even checked into the WP database and this field is set to “yes”, but in the frontend WP does not use archive-deal.php.

    Any idea why this is happening and what could be the solution? By the way, I tried other plugin for custom post types and its archive page is used correctly with the custom post type I created there.

    Many thanks,
    Robert Stojkov

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Amir Helzer

    (@amirhelzer)

    Any chance that your theme runs before the WordPress init hook? Types runs as a plugin, so if the theme does things BEFORE Types, the custom post types will not be registered on time.

    Do you want to try this with the default WP theme? The 2011 theme loads everything in the right sequence. If the archive pages don’t show there too, we’ll need to check Types and see if it might be doing anything in the wrong timing.

    Thread Starter silversurfer

    (@alhemicar)

    Thanks for looking into this, but it turned out that nothing is wrong with Types – the archive-deal.php correctly shows ALL of the custom posts, regardless of the categories I added into my custom taxonomy deal_type; all I had to do is to create a new taxonomy template taxonomy-deal_type.php and use some loop code inside to get what I want from each post under the specific taxonomy entry. I followed this article, https://mondaybynoon.com/20100906/wordpress-archive-pages-taxonomy/

    Thanks again, really like the power and simplicity of Types, especially its built-in support for custom fields.

    Now I’m facing different challenge, and that is how to get the correct permalinks for the custom post, which with Types looks like

    https://mysite.com/post_type/post_title

    while it should follow the taxonomy hierarchy like

    https://mysite.com/post_type/taxonomy_category_1/taxonomy_category_2/post_title

    Cheers,
    Robert

    Plugin Author Amir Helzer

    (@amirhelzer)

    Great. I’m marking this thread as resolved.

    Types doesn’t generate the WordPress rewrite rules. There’s a field, in the custom post type edit, which lets you enter the URL, but Types doesn’t do much with it. It only passes that string to WordPress.

    I recommend that you lookup in the WordPress codex, to learn the syntax of the permalink structure. Personally, I never touch this. I leave it as the WordPress default.

    Since we run sites with tons of content and in different languages, we prefer to keep to the standard and default permalink rules.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Types – Custom Fields and Custom Post Types Management] Custom archive page not used’ is closed to new replies.