I’ve searched and searched, but basically what I’m trying to do is this:
I have a custom post type where there is a custom field called “loop”. What I would like to do is when this field is filled out, I want to use it’s content as a template part. So, for instance:
Custom Field Loop: customloop
get_template_part( ‘customloop’)
So, when I run my query for this post, I basically need whatever’s filled out in that custom field to then be thrown into the get_template_part() so that it pulls that particular loop.
Any thoughts on how to do this?
Thanks in advance.
Yes, we can do this with the get_post_meta() function, just make sure to use the correct key name.