Skip to main content
added 60 characters in body
Source Link
2by
  • 115
  • 6

I will try to elaborate the title. I want to make a post, within this post I want to loop through all posts from a custom taxanomy and extract custom fields.

How is this done in the most efficient way?

What I am thinking about is using the template hierarchy: single-post-{slug}.php

Within this I get the content using:

<?php get_template_part( 'content', '{custom template}' ); ?>

So in content-custom-template.php I will make the loop that goes through all the custom taxanomies.

So as you can see, this will require 2 additional template files for every custom taxanomy I want to do this with (because I need a post for every custom taxanomy).

Is there are more efficient way? How doWhat I make the loop for custom taxanomies?need to know:

  • Is there are more efficient/better way?
  • How do I make the loop for custom taxanomies within the post?

I will try to elaborate the title. I want to make a post, within this post I want to loop through all posts from a custom taxanomy and extract custom fields.

How is this done in the most efficient way?

What I am thinking about is using the template hierarchy: single-post-{slug}.php

Within this I get the content using:

<?php get_template_part( 'content', '{custom template}' ); ?>

So in content-custom-template.php I will make the loop that goes through all the custom taxanomies.

So as you can see, this will require 2 additional template files for every custom taxanomy I want to do this with (because I need a post for every custom taxanomy).

Is there are more efficient way? How do I make the loop for custom taxanomies?

I will try to elaborate the title. I want to make a post, within this post I want to loop through all posts from a custom taxanomy and extract custom fields.

How is this done in the most efficient way?

What I am thinking about is using the template hierarchy: single-post-{slug}.php

Within this I get the content using:

<?php get_template_part( 'content', '{custom template}' ); ?>

So in content-custom-template.php I will make the loop that goes through all the custom taxanomies.

So as you can see, this will require 2 additional template files for every custom taxanomy I want to do this with (because I need a post for every custom taxanomy).

What I need to know:

  • Is there are more efficient/better way?
  • How do I make the loop for custom taxanomies within the post?
Source Link
2by
  • 115
  • 6

Loop through custom taxanomy in post and display custom fields from posts

I will try to elaborate the title. I want to make a post, within this post I want to loop through all posts from a custom taxanomy and extract custom fields.

How is this done in the most efficient way?

What I am thinking about is using the template hierarchy: single-post-{slug}.php

Within this I get the content using:

<?php get_template_part( 'content', '{custom template}' ); ?>

So in content-custom-template.php I will make the loop that goes through all the custom taxanomies.

So as you can see, this will require 2 additional template files for every custom taxanomy I want to do this with (because I need a post for every custom taxanomy).

Is there are more efficient way? How do I make the loop for custom taxanomies?