Having trouble with a conditional statement (2 posts)

  1. benocav
    Posted 3 years ago #

    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 (

    $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...


  2. Michael
    Part-Time Forum Moderator
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic