• Resolved bluemoonpda

    (@bluemoonpda)


    Hi Michael,

    I’ve added your plugin and seen the ‘Please note that this plugin will NOT handle display of registered post types or taxonomies in your current theme.’ I think my issues are display issues but I just wanted to check I hadn’t missed anything obvious using the plugin.

    I’ve installed the plugin and added a recipe post-type;

    • all settings are set to true with the exception of Exclude from Search
    • all support features I require are ticked
    • all built in taxonomies including WP core and the ones I’ve set up are ticked
    • all taxonomies (6 of them) are set up with attach to post type recipe & post
    • all settings set to true with the exception of Show in REST API and Show in quick edit

    As I’ve noted below, the post-type generally seems to be working i.e. can publish a post, view it (after adding some code) on category & tag archives, add new taxonomy terms, use the taxonomies in a filter plugin, use them in other plugins e.g. post loop widget.

    Am I missing anything or is it just a theme display issue I have to solve (see below)?

    Sorry for the long post. Also, my site is hiding behind a coming soon page so I can’t really send a link, but happy to provide information if there is another way.
    Thanks
    Phil

    For additional info:
    I posted the following on my theme provider support:

    I’m looking for some guidance on adding custom post types to your ScrollMe theme (which, thank you, I really like!).
    Apologies in advance for a long intro: I am creating a food / recipe site and (believe) have to use custom post types for the filtering functionality I would like. I have added the Custom Post Type UI plugin, followed the setup instructions, and it appears to have done it’s job. I have the following in place:

    A child theme

    New Post Type -> Recipe
    Custom Taxonomies -> Menu, Ingredients, Chef etc…
    Terms -> e.g for Menu – Breakfast, Main Course etc…

    I can create a ‘Recipe’ post-type and publish it. The post is visible using mysite.com/recipe/recipename.
    The recipe-post is assigned to a core category I’ve called ‘Portfolio’ which I want to use for the portfolio section in the theme.
    The post is assigned to menu & ingredient terms which I require for filtering my posts.
    Categories & Tags (WP Core) built in taxonomies have been ticked for inclusion in the plugin.

    The category view via the archive.php template mysite.com/recipe works with a title ‘Archive: Recipes’ and includes my recipe post types (I’ve added code to my functions.php to make this happen – without the code it only shows core post-types) and likewise for a tag view mysite.com/tag/tag1 shows recipe post types (title ‘Tags: Tag1’).

    A taxonomy view via the archive.php template e.g. mysite.com/recipe/menu/breakfast or mysite.com/menu/breakfast also includes the recipe post-types with the correct title ‘Menu: Breakfast’. So far, so good.

    The bits I’m struggling with (I’ll include them all as they may be related to actions I need to take having registered the CPT)

    Issue 1: To set up the portfolio section in the theme, when I choose the ‘Portfolio’ category in the Portfolio settings, only the core post-types show up in the section. How can I include the recipe post-type in this section? (I tried other categories I linked to recipe post-type to no avail). I cannot figure out what is missing?
    I tracked the code back to line 22 in the customizer.php file [$this->cats = get_categories( $options );] and looked up the function which I don’t think directly supports CPTs. What code do I need to add to update this? (if this is where the problem is)

    Issue 2: I’ve added the Beautiful Taxonomy Filter plugin which is basically working (as sidebar widget). However on the category archive views the ‘placeholder’ i.e. All Recipes, All Menus does not appear on the filter but the individual taxonomy terms are in the dropdown. (It is ok with the tags archive or other taxonomy archives).

    Issue 3: The sidebar layout box does not appear in the edit recipe-post meta-boxes. If I add manually add the custom field ‘scrollme_sidebar_layout’ it does not function correctly i.e. whilst both left & right sidebars will show on a recipe-post, they are both on the right hand side as the css does not work – the option no_sidebar does the following:

    Per Recipe post
    <body class=”single single-recipe postid-148 single-format-standard logged-in custom-background siteorigin-panels”> (hasn’t picked it up therefore shows post at 70% not full width)
    However when working:
    Per Single post
    <body class=”single single-post postid-83 single-format-standard logged-in custom-background no_sidebar”>

    Issue 4: I’ve added the AccessPress Social Share plugin which is working on the single posts. The sharing buttons do not show on the recipe post-type. How do I update for this?
    I can manually add in the shortcode (to the post or template) and know that works.

    Hope you can assist?
    Thanks
    Phil

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Basically, we register the post types and taxonomies for you. If your theme is set up for various things, like the portfolio stuff above, or have some sort of taxonomy filtering setup, we don’t magically add the CPTUI-created post types and taxonomies to the queries that they’re making to make the theme work. The types and taxonomies need to be added somehow to the queries in question, whether via filters that the theme provides to alter, or some sort of option they’ve provided, or simply by making a child theme and altering that way.

    In short, the theme needs to know the types and taxonomies exist in order to work with them. Something we can’t and don’t attempt to make happen.

    Thread Starter bluemoonpda

    (@bluemoonpda)

    Thank you for the quick response. I thought this was the case but just thought I’d check with you.

    Hopefully I will receive the support I need via my theme provider. Whilst there are lots of articles on these forums suggesting the correct way to integrate CPTs, there are many conflicting responses so it is difficult to know where to start. I’m still fairly new to this, so learning as I go is part of the fun, albeit a little frustrating at times trying to test what works and what doesn’t.

    Your plugin has done the first part of the job so thank you!

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issues adding a Custom Post Type to Theme’ is closed to new replies.