• I am trying to create a static page with a slightly different look than my blog. I have managed to create a new page file and uploaded it to my site called “page1.php” I then created a new rule in my style sheet for “pgcontent”
    my new file page looks like this:

    <?php
    /*
    Template Name: Page 1
    */
    ?>

    <?php get_header(); ?>

    <div id=”content”>

    <div id=” pgcontent”>…

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h1><?php the_title(); ?></h1>
    <?php the_content(__(‘Read more’));?>

    <?php endwhile; else: ?>

    <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p><?php endif; ?>
    </div>
    </div>

    <!– The main column ends –>

    I then added this new rule to my style sheet:
    #pgcontent {
    float: left;
    width: 440px;
    margin: 300px 20px 0px 0px;
    padding: 0px 0px 0px 0px;
    }
    #contentmiddle {
    float: left;
    width: 440px;
    margin: 0px 20px 0px 0px;
    padding: 20px 20px 10px 20px;
    }

    i cant seem to align the text in the middle of the page. I dont know if i should use the “”contentmiddle or the new “pgcontent” or if I have the margins wrong.
    here is a link to the page:
    https://www.aheadofthecurveatmidlife.com/test-product-page/?preview=true

    any help would be greatly appreciated

Viewing 1 replies (of 1 total)
  • I clicked your link and loaded your page and it showed the 404 Page Not Found error aligned to the left in the middle column.

    A sidebar also appeared below it and it was aligned to the right.

    I believe it is the r_sidebar.

    To center align content in the middle panel, you would probably need to declare text-align on your contentmiddle and make sure that the actual content within doesn’t have differently declared text alignment.

Viewing 1 replies (of 1 total)
  • The topic ‘modifying template for a static page’ is closed to new replies.