Support » Themes and Templates » Showing 2 pages on the same.. page?

  • I originally built my website with just html/css, but decided it would be better/way more educating to build it in wordpress, however my website used 2 separe columns on the entire site and however I try I cannot incorporate that into my wordpress-theme. Here’s what I have to so far:

    <?php get_header(); ?>
    <div class="centerdiv">
    	<div id="main">
    		<div class="leftdiv">
    		<!-- starta loopen -->
    		<?php while ( have_posts() ) : the_post(); ?>
    		<article id="<?php the_ID(); ?>" <?php post_class(); ?>> <!--post-<?php the_ID(); ?>-->
        		<header class="post-header">
        		<?php if ( is_archive() || is_search() ) : // Visa bara ett utdrag på arkiv- och sök-sidorna ?>
        		<div class="post-utdrag">
        			<?php the_excerpt( __( 'Läs mer →' ) ); ?>
        		</div><!-- slut post-utdrag -->
        		<?php else : ?>
        		<div class="post-content">
        			<?php the_content( __( 'Läs mer →' ) ); ?>
        			<?php wp_link_pages(); ?>
        		</div><!-- slut post-content -->
        		<?php endif; ?>
        		<footer class="post-meta">
    		<?php endwhile; ?>
    		<?php if (  $wp_query->max_num_pages > 1 ) : ?>
    		<nav id="nav-nedan">
        		<div class="nav-fore"><?php next_posts_link( __( '← Äldre inlägg' ) ); ?></div>
        		<div class="nav-efter"><?php previous_posts_link( __( 'Nyare inlägg →' ) ); ?></div>
        	</nav><!-- slut nav-nedan -->
    		<?php endif; ?><!-- avsluta loopen -->
    		</div><!-- slut leftdiv -->
    		<div class="rightdiv">
    		<?php $recent = new WP_Query("pagename="); while($recent->have_posts()) : $recent->the_post();?>
    		<?php the_content(); ?>
    		<?php endwhile; ?>
    		</div><!-- slut rightdiv -->
    	</div><!-- slut main -->
    </div><!-- slut centerdiv -->
    <?php get_footer(); ?>

    What you can see is I show a page in the leftdiv and I would like to show another one in the rightdiv, but I don’t want to have a different page-template for all my pages. Therefore I thought I could make one page with the name “Home” and one called “Home2” and use
    new WP_Query("pagename=wp_title();2");
    or something, but it never seems to work. I admit that my php is a little fuzzy, and I would be grateful for any help. Any ideas as to what I’m doing wrong or how I might do it more elegant?

  • The topic ‘Showing 2 pages on the same.. page?’ is closed to new replies.