Image with link in sidebar
-
I hope someone has a brilliant idea for the following simple problem.
I’m using WP as CMS for someone who’s website I have been maintaining for many years now and I’d like him to do it himself.
I need to be able to add images with a (external) hyperlink in the side bar. These images are like banners, only difference is that they are not code that fetches the image from an external site (but actual images with a link).
I can’t use a gallery (like NextGen) because if you click on the thumbnail it will only show a larger version of that image instead of taking you to the website of the banner.
I can’t use a text-widget and hardcode the image + hyperlink in it, because he won’t be able to add or change something later.
Plus, it needs to be in the sidebar so that it shows up on all pages, not just as post on one page.Does anyone know of a widget/plugin with wich you can easily add pictures with a link attached to it?
Mind you, the guy is an absolute n00b with the internet, Java is an island and PHP some sort of plastic…
-
1. Create a category called “Sidebar Links”.
2. Ensure that this category is excluded from all queries in other archive templates
3. Add the images to this category – 1 per post.
4. Create a query using get_posts() to pull the images into sidebar.php
Mmmm, that’s quick Esmi 🙂
Let’s see if I understand you correctly;
If I create a new post (hooked to this category) and add the linkedimage to it, will this query than show the just the image (incl. link)?Thanks for the superfast reply btw
Yes – assuming you code it to do so in your sidebar get_posts loop.
Thanks!
Although I’m not much of a programmer, I’ll give it a shot.
The topic ‘Image with link in sidebar’ is closed to new replies.