[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

insert page specific content into widget area in wordpress (for about 20 diferent pages)

Posted on 2010-11-23
5
Medium Priority
?
715 Views
Last Modified: 2012-05-10
I have about 20 pages (not posts) in my wordpress deployment I need to add some html (for a calendar) in the top sidebar that is specific for each page.   how can i do this?
0
Comment
Question by:bcoussens
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
AndyBeard earned 1000 total points
ID: 34201991
Simple way would be a php widget and then use

if is_page('1') {
do something
} else if is_page('2'){

}

blah blah blah

or you could get more sophisticated and store stuff in arrays

A third option would be to use a widget, either php or one of many which are designed to output the contents of meta data.

Then on the posts concerned you could add some custom meta data for the calendar.
0
 

Author Comment

by:bcoussens
ID: 34202329
Ok i am not good with php, thought a widget might already exist but cant find one.  

I am trying your "if" code,

not sure how to specify the page?
 Url is: http://bookings.australianluxurystays.com.au/?page_id=269

would i use '269'

or 'page_id=269'
0
 

Author Comment

by:bcoussens
ID: 34202346
Have put the below code in a text widget,  I guess i need to start with something to let it know to read the php
if is_page('269') {
[booking nummonths=1 type=5 form_type='standard']
} else if is_page('270'){
hello page 270
}
else{

}

Open in new window

0
 
LVL 15

Expert Comment

by:AndyBeard
ID: 34202595
You need to be using a text widget that supports php

you should just use the numbers

Here are some good samples on conditional tags
http://codex.wordpress.org/Conditional_Tags

But lets go for a plugin solution
This will allow you to display custom fields
http://wordpress.org/extend/plugins/get-custom-field-values/

Now we need a way to add an interface for adding the data to each page
http://wordpress.org/extend/plugins/custom-fields/

0
 

Author Closing Comment

by:bcoussens
ID: 34420022
did not respond with any further confirmation
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wordpress Horizontal Drop-Down Menu In this tutorial I will show you had to add a WordPress horizontal navigation menu to your theme. I have searched and searched for a good tutorial on creating a WordPress nav menu without adding a plug-in or us…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question