wordpress-theme / page.php
page.php
Raw
<?php get_header(); ?>
    <div class="home-info">
            <?php
            if( have_posts()){
                while( have_posts()) {
                    the_post();
                    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
                    $thumbnail_url = get_the_post_thumbnail_url('', 'post-thumbnails');   
                    ?>
                    <div class="page-img-wrapper">
                        <img alt="'" src='<?php echo $thumbnail_url; ?>'>
                    </div>
                    <?php
                    } 
                    ?>
                    <p class=""> <?php the_content(); ?>
                    </p><br>
                    <?php 
                }
            } ?>
        </div>
        <?php 
        // appear only if about page with staff category
        if (is_page('About')) {
            query_posts('category_name=Staff');
            echo "<h1 class='staff-heading'>More About Palm</h1>";
            if ( have_posts() ) {
                while ( have_posts() ) {
                    the_post(); 
                    ?>
                        <article class='staff'>
                            <?php   
                                if( has_post_thumbnail() )
                                { // check if the post has a Post Thumbnail assigned to it.
                                    $thumbnail_url = get_the_post_thumbnail_url('', 'post-thumbnails');    
                                }?>
                                <div class="img-wrapper">
                                <img  alt ="" src='<?php echo $thumbnail_url; ?>'>
                            </div>
                            <?php
                            ?>
                            <div class='staff-info'>
                                 <?php the_title();?> <?php the_content() ?>
                            </div>
                        </article>
                        <?php
                    }
                }
            }
        ?> 
<?php get_footer(); ?>