• OK. Six hours ago, I hated WP.Now I am starting to like it and getting excited (Thanks esmi!)
    Now, could someone tell me if am doing this right?

    My goal is to build a simple NON-BLOG site.
    I am starting with 3 static pages (Home page, About Us, & Services) They will all be different, so…..

    I created 3 child “page-templates” (Home page, About Us, & Services)and assigned each page to the related page template. Was this the right way to do this? (I removed the sidebar on each template page) Thanks, Buffmin

    You can see my junk site at https://doubledoubleny.com/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Buffmin2

    (@buffmin2)

    (sorry, I couldn’t find this previous post).

    I never did get a reply, so I was wondering if someone could please tell me if I have the right idea. Thanks, Buffmin2

    I have attached my code for one one my “template” pages.

    <?php
    
    /**
     * Template Name: About Us
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */
    
    get_header(); ?>
    
    		<div id="container">
    			<div id="content" role="main">
    
    			<?php
    			/* Run the loop to output the page.
    			 * If you want to overload this in a child theme then include a file
    			 * called loop-page.php and that will be used instead.
    			 */
    			get_template_part( 'loop', 'page' );
    			?>
    
    			</div><!-- #content -->
    		</div><!-- #container -->
    
    <?php /*get_sidebar(); */?>
    <?php get_footer(); ?>

    All of those pages look identical (except for the photo) — so no, you don’t need a separate template for each one. You only need to create a custom template if you want to CHANGE something (aside from CSS styles or content) in the standard template(s).

    Have your read through all the Pages and Template information in the Codex?

    BTW, you can see all of your forum posts by clicking on “Member” just below your user name…

    Thread Starter Buffmin2

    (@buffmin2)

    Thank you for your reply (and info).
    Good point. I probably only need 1 template (as like you said, they are all the same).

    Now, if I wanted to lay out the pages with custom content as I am used to doing (divs,etc and using css), would I do that while in the “html tab” of each page, or on the actual template page?

    I hope this made sense. Thanks.

    Yes, you generally add content in the usual way — using the HTML or the Visual editors. Some of what displays on the page IS coded into the php files — i.e. “Comments” or the Header text or the tagline — but as you’ve already done, some of those can be modified in the theme options in the visual editor.

    If you just want to get rid of something like the above, an easy fix is to use “display: none;” in the CSS code for that element.

    CSS changes are made to the child stylesheet — click on the tab for that. CSS changes can affect either all pages using that template or just a specific page based on the content — it depends on how the CSS is coded (selectors).

    Thread Starter Buffmin2

    (@buffmin2)

    Thank you very much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Did I do this right?’ is closed to new replies.