I’m re-building an HTML/CSS static site into a WordPress custom theme. This is ambitious because I only know HTML and CSS. I couldn’t write a full PHP tag that functioned correctly to save my life – just for reference. I’ve done this by following a Lynda tutorial. So far, everything’s good.
To be clear, I’m not looking for “free development help”, but if someone could kindly let me know what kind of approach I might take, I’ll happily do the PHP research myself to find the actual code. Here’s what I want to accomplish…
I have a site that features different people with a personal bio page and several posts they’re in. The bio page uses a template that gets information dynamically (name, age, etc) by using Custom Fields and get post meta, like this:
<h1><?php echo get_post_meta($post->ID, 'name', true); ?></h1><br /><br /> <h2>Name:</h2> <p><?php echo get_post_meta($post->ID, 'name', true); ?> </p>
That works fine. What I’d like to do now, is pull in every post they’re in by “tag”. In other words, if you clicked on “Sally”, her bio page would show the templated meta (above), and below that, it would say “Here are the posts involving Sally”. Looking for what kind of approach I need to create a loop that looks for a post tag of Sally, and echos whatever number of posts there are to her bio page (could be one, could be five). The kick – this bio page is used for other people as well, so it needs to be variable.
I have a current “messy” solution, but it’s not dynamic. Is this possible, or do I need to set up a unique template for each person?
Help is appreciated. I can give a link, but with respect, I’m an adult content developer so I’ll wait to see if that’s necessary.
- The topic ‘Template page with get post by "Tag"?’ is closed to new replies.