• So I took the task on of creating a new custom page for my theme. It was surprisingly easy. I created a blank notepad doc and called it test.php. Then, I uploaded it to my theme’s pages directory. I go to the theme editor, open it up and add the following:

    <?php
    /*
    Template Name: Business
    */
    ?>

    Sure enough.. when I go to create a ‘New Page’, it’s now under the ‘Page Template’ dropdown. So.. now I go to the Theme editor, add the header:
    <?php get_header(); ?>
    Voila.. there it is. I add only 1 sidebar (instead of the 3 that every other page has):
    <?php include(TEMPLATEPATH."/sidebar_left.php");?>
    and then…. I add the footer:
    <?php get_footer(); ?>

    All done! Looks great!

    Now.. I need one last piece. What do I add to this code to make it see the new content I’m adding in the Visual Editor for the page?
    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter wolfdogg

    (@wolfdogg)

    Hooray.. I figured it out!

    <div id="content">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<h1><?php the_title(); ?></h1>
    
    		<?php the_content(__('Read more'));?><div style="clear:both;"></div>
    
    		<!--
    		<?php trackback_rdf(); ?>
    		-->
    
    		<?php endwhile; else: ?>
    		<?php endif; ?>

    That brings it all in nicely.. add
    <div id="contentnarrow"> after the “content” id tag and close it at the very bottom if you have a right sidebar.. it seems. Maybe this helps someone else..

Viewing 1 replies (of 1 total)
  • The topic ‘How to add content to a custom page?’ is closed to new replies.