Jump to content
Sign in to follow this  
organicman

Different content in widget on each page

Recommended Posts

organicman

I put a photo into an html Widget at the top of my primary sidebar, on the left side of the site. But it shows up on each and every page. I want a different photo in that widget on each page. How do I go about that?

Share this post


Link to post
Share on other sites
bryan-hadaway

Widget Logic plugin, indeed. Thanks, Bryan

Share this post


Link to post
Share on other sites
organicman

This is not exactly what I need. I want to have a certain widget (Rich Text) APPEAR on every page, but have the CONTENT (photos, mainly) of that particular widget be DIFFERENT for each page. Anyone know how accomplish this?

Share this post


Link to post
Share on other sites
cmunns

This seems like something you would be better served by handcoding and using conditional statements, is there a consistent type of page you need to show particular photos? and what is inside the rich text widget?

Share this post


Link to post
Share on other sites
organicman

I am building a site that is mainly a CMS site. About 10 pages nearly all of which will be single-post pages, and each page needs its own photo in the top left of the primary sidebar. Do you know of a photo widget that would allow me to display a different photo in the widget, on a per-page basis?

Share this post


Link to post
Share on other sites
kastelic

I know of no widget that will do this. Here's the link to info on WP conditional tags: http://codex.wordpress.org/Conditional_Tags Your code should look something like this:

	<?php
	if (is_page(32)){
	   echo "
	} else if (is_page(33)){
	   echo "
	}
	// and so on
	?>
	
	[/code]

Share this post


Link to post
Share on other sites
kastelic

Hmm, i'm having trouble posting PHP here. The line should read like:

echo "";[/code]

Share this post


Link to post
Share on other sites
kastelic

Damn, again. Anyway, theres an image tag there.

Share this post


Link to post
Share on other sites
arretx

Could you not use two plugins? One for widget logic where a given widget is only shown on a page or pages you specify, and then a plugin that allows you to embed PHP into your text widgets? Simply code your text widgets to handle your custom content per page and then set each text widget to show depending upon the page you're on.

Share this post


Link to post
Share on other sites
cmunns

If you use a widget like PHP-Exec which executes PHP then its redundant to have the Widget Logic plugin bc you could code the conditional tags yourself.

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  

×