Jump to content
Sign in to follow this  
kaspr

A different image in the sidebar for different pages

Recommended Posts

kaspr

I am only working on a local install for my site so I can't give you a link. I would like to add a unique image in the sidebar specific to the page that I am on. ie, page 1 has image 1 in the sidebar page 4 has image 4 in the sidebar Is there a way of doing this? Thanks, Jim

Share this post


Link to post
Share on other sites
catrina

It's possible to use a page's unique ID number and CSS to add a unique image in the sidebar area. Do you know where to find a page's ID number?


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
kaspr

I can find the id number, but what type of css would i need to input?

Share this post


Link to post
Share on other sites
kastelic

Make a text widget and put a div with a class in it like: <div class="my-image"></div> Then in your CSS you can differentiate the pages like so:

	.my-image{
	width:50px;
	height:50px; /* maximum dimensions of the images*/
	background: url(DEFAULT-IMG-URL) no-repeat;
	}
	
	.page-id-32 .my-image {background: url(AN-IMG-URL);}
	.page-id-35 .my-image {background: url(ANOTHER-IMG-URL);}
	

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×