Pull Specific Post in Custom Subnav item
-
Hi, I have a custom subnav tab called “style” that contains a specific post. So I click on any member and can navigate to this tab with the url being a child of this member. (ex. http://community.abeo.us/members/joes/style/)
What I need help with: Each member has a post titled “DISC”. How can I pull specifically that post unique to each member profile. For example, when I open member “Jason” style tab, it needs to pull his post titled “DISC”. I need this is possible with the author filter but I don’t know php enough to compose it right.
My permalink structure is: /%author%/%postname%/
Here is the code that’s pulling the post. As of now its just pulling in a post id=38.
` $post_id = 38;
$queried_post = get_post($post_id);
$content = $queried_post->post_content;
$content = apply_filters(‘the_content’, $content);
$content = str_replace(‘]]>’, ‘]]>’, $content);
echo $content;}`
Any help will be greatly appreciated!
- The topic ‘Pull Specific Post in Custom Subnav item’ is closed to new replies.