
Untitled
By:
deano89 on
May 30th, 2011 | syntax:
None | size: 1.48 KB | hits: 250 | expires: Never
This is what i have at the minute. But I would like the div tags in the page.php but when i do that all i get is plain text.
page.php
<?php if (is_page ('Home', 'About', 'Services', 'Pricelist', 'Contact')) ?>
<?php get_template_part( 'loop-page'); ?>
<?php if (is_page ('News')) ?>
<?php get_template_part( 'loop-news');?>
<?php if (is_page ('Portfolio')) ?>
<?php get_template_part( 'loop-portfolio');?>
loop-page.php
<?php
/*Template Name: loop-page.php
*/
?>
<?php get_header(); ?>
<div id class="content_container"> <?php get_sidebar (); ?>
<div id class="main_content">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<p><?php the_content(); ?></p>
</div>
</div>
<?php endwhile; // end of the loop. ?>
<?php get_footer(); ?>
loop-portfolio.php
<?php
/*Template Name: loop-portfolio.php
*/
?>
<?php get_header();?>
<?php query_posts('category_name=portfolio&posts_per_page=3');?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id class="content_container"> <?php get_sidebar ();?>
<div id class="main_content">
<div class="post_title"><h1><?php the_title();?></h1></div>
<div id class="clear"></div>
<div id class="picbox"></div>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<p><?php the_content();?></p>
</div>
</div>
</div>
</div>
<?php endwhile; // end of the loop. ?>
<?php get_footer();?>