I am attempting to have different pictures on all of my pages built using blogging platforms.

And So I possess the following during my index.php file, archive.php file, page.php file, etc:

<img src="<?php bloginfo('template_url'); ?>/images/<?php echo $toppic; ?>" alt="page1" id="mainPageImg" />

Now, during my page.php file, I've the next:

<?php
    // TOP PICTURE DEFINITIONS
    if ( is_home() ) {
        $toppic == 'page1.png';
    }
    if ( is_page('articles') ) {
        $toppic == 'page2.png';
    }
?>

Why this doesn't work? I attempted it with one equal (=) sign...

EDIT: Basically define $toppic at the very top, for instance, within the index.php file the following:

<?php $toppic = 'page1.png'; ?>

It works. Therefore, it should be something which has related to the conditional if is_page/is_home claims. Any ideas?

Thanks! Amit

Okay, I discovered the solution.

This is exactly what must be done. For that articles (blog) page, at the very top section you have to put the following:

<?php // TOP PICTURE DEFINITION FOR ARTICLES PAGE
        if ( is_home() ) {
            $toppic = 'page1.png';
        }
?>

Then, inside your page.php file, you are able to control the image at the very top for those other pages (except 404, where you'd have to put a is_404() inside your 404.php. Making this what it really appears like:

<?php
    // TOP PICTURE DEFINITIONS
    if ( is_page('english') ) {
        $toppic = 'page1.png';
    }
    if ( is_page('aboutus') ) {
        $toppic = 'page1.png';
    }
    if ( is_page('newspaper') ) {
        $toppic = 'page1.png';
    }
    else {
        $toppic = 'page1.png';
    }
?>

And lastly, to be able to implement this, make use of the following HTML/php syntax:

<img src="<?php bloginfo('template_url'); ?>/images/<?php echo $toppic ?>" alt="page1" id="mainPageImg" />

That's all. Phew. Finally first got it to operate :) Needed to get it done for any client, too!

The slug for the Articles page needs to be understood to be articles. This really is occur the edit page interface, see these directions.