How do I customize template via “$post_author” variable???
-
I am looking for a way to insert a code into my template dependent upon which user’s post the page is on. However, this may go into the header and sidebar, not just post pages. Basically something like this:
<?php if [THISPAGE]($post_author=”Joe”) { echo ‘<img src=”joesimage.gif”>’ };
else { echo ‘<img src=”regularimage.gif”>’ } ; ?>Then it would show “joesimage.gif” (just as an example), on all of Joe’s posts. And if the page was NOT one of Joe’s posts (i.e. other people’s posts or pages like categories, archives, etc.) ALL other pages not posted by anyone (categories for example), then it would show something else.
How would I code it so it will change that code in the header.php and sidebar.php (rather than the post.php template)? I know it’s incorrect, so if someone can just tidy it up properly so it can do what I’m asking, I’d extremely appreciate it.
Thank you for your time.
- The topic ‘How do I customize template via “$post_author” variable???’ is closed to new replies.