• Can you integrate the recipe course and cuisine taxonomies so they extend the regular post type with a recipe taxonomy metawidget?

    This will make it easier to add posts that contain recipes to menus, to display them within widgets, to list them with shortcodes and otherwise facilitate post filtering by recipe types.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Brecht

    (@brechtvds)

    The regular post type? You mean associate courses and cuisines with the post that includes the recipe?

    Brecht

    Thread Starter Lee Hodson (VR51)

    (@leehodson)

    I meant a little freer than that. I meant for you to add a courses and cuisines taxonomy to all regular posts, or even to add an option within WP Recipe Maker that allows the user to select the post types to extend, and integrate the new post cuisines/courses taxonomies with the recipe card courses/cuisines fields.

    Your interpretation of the idea might work too: only add the recipe taxonomy to a post when a recipe is included within a post.

    Plugin Author Brecht

    (@brechtvds)

    If you just want a courses and cuisines taxonomy for your regular posts (or other post types) you can use a plugin like https://www.ads-software.com/plugins/custom-post-type-ui/

    Brecht

    Thread Starter Lee Hodson (VR51)

    (@leehodson)

    Thanks for that info. I am aware of it already. That doesn’t solve the problem of its own because we need to keep WP Recipe Maker cuisines/courses synchronised with a recipe post’s cuisine/courses taxonomies.

    The introduction of a recipe taxonomy for posts is best added as part of WP Recipe Maker’s core code so that the recipe form’s fields for courses and cuisines can pull data from a post’s recipe taxonomies (where set) during autofill and push data to the post’s recipe taxonomies on post save.

    If I add the taxonomies outside of WP Recipe Maker’s core code then any synchronisation between the recipe card’s data and a post’s recipe taxonomies would work in one direction only e.g. the recipe card would not reflect the post’s taxonomy unless manually added to the recipe card.

    Plugin Author Brecht

    (@brechtvds)

    What is it you’re trying to do specifically?

    Brecht

    Thread Starter Lee Hodson (VR51)

    (@leehodson)

    We are trying to create a user friendly way to filter posts according to recipe cuisine/course data and display that filtered data in an organised way e.g. to create an index page of cuisines fashioned as a grid of posts listed by cuisine type (not necessarily a mosaic or Ajax filterable wall) or, example 2, to add cuisines/courses to the menu.

    We could use regular categories and/or tags but this would result in too many tags/categories for authors to quickly sift through and would result in content creation task duplication e.g. add cuisine/course info to recipe then add it again as a category/tag.

    I can extend WP Recipe Maker with shortcodes or add a new widget that queries the database for recipe cuisines/courses then displays recipe results according to a preferred format but I feel it would be more useful if WP Recipe Maker extended the regular post type with a cuisine/courses taxonomy because it will then work with other (generic) plugins that help with content organisation and display.

    Plugin Author Brecht

    (@brechtvds)

    Like I mentioned in the other topic we recommend using the Recipe Grid for that:
    https://bootstrapped.ventures/wp-recipe-maker/recipe-grid/

    Other generic plugins that support custom post types should already work as well.

    But I’ll add it to our idea list!

    Brecht

    Thread Starter Lee Hodson (VR51)

    (@leehodson)

    Actually, the post type and taxonomies are hidden from view but they do already exist.

    The taxonomy is set in class-wprm-taxonomies.php and post type is in class-wprm-post-type.php. Setting them to work with menus and widgets is just a case of editing the options used to register the post type and associated taxonomies. When the necessary changes are made the recipe titles still redirect to their parent page so SEO duplicate content warnings should not occur.

    What is your opinion of the following changes:

    Set post type args in class-wprm-post-type.php to:

    		$args = apply_filters( 'wprm_recipe_post_type_arguments', array(
    			'labels'             => $labels,
    			'public'             => true,
    			'rewrite'            => false,
    			'capability_type'    => 'post',
    			'query_var'          => true,
    			'show_ui'             => true,
    			'show_in_nav_menus'             => true,
    			'supports'             => array('title','editor','custom-fields','revisions'),
    			'taxonomies'             => array('wprm_course','wprm_cuisine','wprm_ingredient'),
    		));

    Set taxonomy args in class-wprm-taxonomies.php to:

    		foreach ( $taxonomies as $taxonomy => $labels ) {
    			$args = array(
    				'labels'            => $labels,
    				'hierarchical'      => true,
    				'public'            => true,
    				'show_ui' 			=> true,
    				'query_var'         => true,
    				'rewrite'           => true,
    				'show_in_rest'      => true,
    				'show_ui'             => true,
    				'show_in_nav_menus'             => true,
    				'has_archive'             => true,
    			);

    I guess edits here would improve compatibility with WPML, too, e.g. enable the the default editor admin pages for this post type but replace the main content editor (currently fills with the recipe Notes content block) with styled custom fields.

    Plugin Author Brecht

    (@brechtvds)

    We have plugin hooks that allow you to do just that, if you want.
    For the main plugin we will leave it like this at the moment.

    Brecht

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Course and Cuisine Taxonomies’ is closed to new replies.