Where do you have that code?
What is it supposed to do? (according to you)
Link to an example? Doesn’t work meaning… ?
Ok, I have that code in an include archive.
At the end of the index.php I have the next code:
<?php include (TEMPLATEPATH . '/columna3.php'); ?>
And in this archive I have the is_page.
If I am in a page with id=2, it must show me a title with some text. But nothing happens.
So, is that conditonal in:
– index.php?
– columna3.php
What is “include archive”?
The conditional is in columna3.php
Do you have a page.php template file in your theme? If yes, then index.php is NOT used to display your page_id=2 – which means the code is useless in index.php.
The conditional you are using is for Pages.
I dont’t understand. I have a page.php template file. But what can I do???
columna3.php is called from index.php and from page.php. And never happens anything.
If it is called into the page.php, too – then it should work.
Give a link to your Page that has ID#=2.
http://www.address.com/page/
[mod – you edited the address, and it is wrong now! your page_id=2 was the About Page]
Put your columna3.php to http://wordpress.pastebin.ca and post back with the address
I don’t know where is the problem. I have used the same in previous wordpress versions.
is functions don’t work. Any idea?
Assuming you are wanting to put in your own text, you could do this, using echo to write the stuff you add:
<?php if (is_page('2')) {
echo('<h3>Your Title here</h3><p>your text content here</p>');}
else {}
?>
or, if you want to pull the actual title and content from the db, then you do something like:
<?php if (is_page('2')) {
the_title('<h2>','</h2>');
the_content();
}
else {}
?>
is that what you are after?
HTH