Having trouble with a conditional statement
-
Hi Guys,
I’m wanting to do something very simple but just can not seem to achieve it.
I have been trying to use an if statement in my sidebar.php that will load a different post when on the Contact Page.
In simple terms I need something like this…
If page=’contact-us’
display (<?php
$post_id = 44; // Get the Post ID
$queried_post = get_post($post_id);echo $queried_post->post_content;
?>
)else if
display (<?php
$post_id = 55; // Get the Post ID
$queried_post = get_post($post_id);echo $queried_post->post_content; // Show the content of the Post
?>
}I hope someone can help me…
Cheers
Ben
The topic ‘Having trouble with a conditional statement’ is closed to new replies.