• I’m using WPRM on a custom post type – recipes – and was setting up a custom search. Is it possible to use the built-in Course or Cuisine taxonomies to filter the posts by (using a drop-down list)? I was able to retrieve a list of the courses using get_terms, so I know they are registered as a taxonomy, I’m just not sure if those taxonomies are linked to the current post the recipe is embedded in, or to the recipe itself (which as explained, is a hidden custom post type).

    If anyone has done this before, I’d appreciate an example. Thanks!

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

    (@brechtvds)

    Hi there,

    They are linked to the recipes themselves. With our WP Ultimate Post Grid it’s actually quite easy to set up a grid with dropdown filters: https://bootstrapped.ventures/wp-recipe-maker/recipe-grid/

    Kind regards,
    Brecht

    Thread Starter dansig

    (@dansig71)

    Thanks for the quick reply. That’s kinda what I thought, so for my purposes I simply recreated the Courses taxonomy on the Recipes CPT. It’s a redundancy I wish I could have avoided

    Do you have plans for the future to provide methods to query the embedded recipes and link them to the page they are embedded in? Or will the WP-UPG plugin be the only way to display and filter them?

    Plugin Author Brecht

    (@brechtvds)

    They are already linked to the parent page. In the wprm_parent_post_id meta you can find the ID.

    Brecht

    I think dansig meant this: https://www.ads-software.com/support/topic/course-and-cuisine-are-not-links/

    I had the same issue and I’ve performed a workaround (probably not very consistent, but working) until Brecht add the functionality. But I wonder: how does this affect to SEO of Recipes?

    1. First I’ve used the plugin Bulk Term Generator to copy the terms of “Course” and “Cuisine” taxonomies to “Category” and “Tag” respectively.
    2. I’ve created my own template for recipes. I’ve used “Simple” as template to modify.
    3. Then I’ve modified the loop for printing taxonomies and replaceecho $term->name;
      by

      if ($key == 'course') $base_archive .= get_option( 'category_base' ) . '/';
      else if ($key == 'cuisine') $base_archive .= get_option( 'tag_base' ) . '/cocina-';
      else $base_archive .= get_option( 'tag_base' ) . '/';
      ?>
      <a href="<?php echo site_url( $base_archive . strtolower($term->name) . '/' );?>"><?php echo $term->name; ?></a>
      <?php

    Note: I’ve added a prefix to my Cuisine’s tags called “Cocina” so the slug has been modified as “cocina-“.

    Of course this obligates me to tag 2 times the recipe: first in the recipe itself (especially to not lose the tags when the update of the plugin is done) and then in the post for category and tags.

    Hope it’s useful.

    • This reply was modified 8 years, 2 months ago by Navarro.
    • This reply was modified 8 years, 2 months ago by Navarro.
    • This reply was modified 8 years, 2 months ago by Navarro.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Ability to Filter on Course or Cuisine’ is closed to new replies.