php conditional statement in wordpress?

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Guest
I want to add content in the sidebar.php file which will be conditional on the actual page being rendered.

Assume I have 5 pages, and each page needs its own description, which looks nice in the sidebar.

Can you layout the proper code for this statement:

if page = some_page
echo "my text for some_page"

else

if page = some_page_2
echo "my text for some_page_2"

if page = some_page_3
echo "my text for some_page_3"

.
.
.
if page = some_page_5
echo "my text for some_page_5"



So what is the variable being checked (the wordpress page ID) and how would I print my actual paragrahp of text in the if else statement?

Thanks!
 
Back
Top