So I'm wondering exactly how I could display my latest post on a page only in certain conditions. I've been looking over the conditions page in the codex, but I'm not seeing how I could do what I have in mind. For example: I will have multiple vendors selling on my site. Each vendor will have their own page on the site. There will be one featured item for sale on the home page,(which we figured out how to do here: Display newest post's custom field content on homepage, daily ) and when it happens to be a certain vendor's item, I would like the post to display on their specific page as well. So I would need to only show the newest post(again, I got help with this in the provided link) on their page, ONLY when it happens to be their item. As always, thanks in advance!

so are you asking to display the vendor's information on the home page, or are you asking to highlight the featured item on the vendor's page?
–
guiniveretooOct 1 '12 at 3:56

Also, what's the relationship between a Product and a Vendor? how have you set them up? How do you decide when a vendor should be the featured one - is it always the same vendor forever, or does that change often? Do you have a way to change the featured vendor on the back-end, or do you just plan on changing it in the code every once and a while?
–
guiniveretooOct 1 '12 at 3:56

I'm trying to highlight the featured item on the vendor's page, if it happens to be their item. It will be changed often, maybe even daily if it takes off well enough. Basically, if the vendor agrees to offer a product for a discount, their item will be featured on the home page. When that happens, I would like for that same post to be shown on their individual page. It will be changed in the backend, via custom fields if all goes as planned.
–
Anthony MyersOct 2 '12 at 0:54

1 Answer
1

Possibly you could wrap the code on the vendor's page in a comparison. So if the vendor's name is the Title of their page, and the newest post has a meta field that hold's the vendor's name, it could look like this:

Very cool! Thank you for your reply! I will give this a go.
–
Anthony MyersAug 27 '12 at 23:54

Do you think you'd have a few minutes to help me with this further? I have been trying to get this and other variations of this to work all morning, but I'm not having any luck at all. nothing is being output whatsoever.
–
Anthony MyersSep 30 '12 at 19:26

So basically, I'm on the vendor's page, and what your code is saying is that if the Title of the vendors page matches a custom field on the newest post, then I should be able to display the newest post on the vendors page. For example, let's say the vendor's name and page is Awesome Vendor, then all I would need to do is add a custom field to the newest post that holds, "Awesome Vendor" in it right? It's just not working. Do I need start the loop? Because I'm trying that now, and that's not working either.
–
Anthony MyersSep 30 '12 at 19:30