This is a premium members-only content.

To view the rest of the content, please sign up for membership ($37/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

For adding code blocks wrap the code in three backticks. Markdown should work.
Provide a URL of your site/webpage if something is not working.

9 comments on “Related Posts in Oxygen”

        1. Try changing

          // Get the tags for the current post.
          $tags = get_the_terms( get_the_ID(), 'post_tag' );

          // Get the categories for the current post.
          $cats = get_the_terms( get_the_ID(), 'category' );

          to

          // Get the meal types for the current post.
          $tags = get_the_terms( get_the_ID(), 'meal-types' );

          // Get the ingredients for the current post.
          $cats = get_the_terms( get_the_ID(), 'ingredients' );

          1. Hi Sridhar, I actually went back to using the WP core categories and tags as it was a site that has extensive taxonomies. I was able to get the cpt coming through on the archive pages using some code from the CPT UI site – however, the related posts are not showing on the recipe template I built. They show on the normal WP posts perfect. Is there a way to have them on the recipe cpt’s? grubgalore.com

magnifiercross
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: