Friday, 15 April 2011

php - Wordpress specific content -



php - Wordpress specific content -

good day all,

i'm new in wordpress. want inquire on how display page content in different div. when seek code. won't display anything, page won't load. help much appreciated. thanks!

<?php if($_server['request_uri'] == '/wordpress/?page_id=5'): ?>

<div style="width:960px; float:left;min-height:290px;word-wrap: break-word"> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php endwhile; // end of loop. ?> </div>

<?php else: ?>

<div style="width:640px; float:left;min-height:290px;word-wrap: break-word"> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php endwhile; // end of loop. ?> </div>

<?php endif;?>

if have access theme files, re-create , paste page.php, rename duplicate file page-about.php, about slug of page. can have number of page duplicates.

to find slug of page, go page editing area, screen option > view slug.

php wordpress

No comments:

Post a Comment