WordPress.org

Ready to get started?Download WordPress

Forums

3 colums display (2 posts)

  1. adnanius
    Member
    Posted 4 years ago #

    Greetings, I'm new to php, and I've been given a theme by my professor, that I should explore before modifying and adding stuff.
    To start with, I have a problem with the 3 colums display. Apparently, it's because of category ids, which where fixed in mysql database differently than at my professor's database.

    Each column is supposed to display one category.
    I've been able to get 2 colums working, center and right colums, each displaying posts from one category (in the code below, categories 4 and 3)

    Now I've still have one category id to modify somewhere in my theme files, but I'm being unable to find which one.

    The 3rd column now displays Meta data

    I belive it all depends on how the 3 colums display has been defined, but how can I find that out?? where should I look. I did lots of greps looking for "category", "in_category", "cat", .... with no luck...

    <?php get_header(); ?>
    
    	<div id="content">
    
    		<div id="content-home-left">
    
    			<?php
    			$HomePagePosts = new WP_Query();
    			$HomePagePosts->query('cat=4');
    			?>
    
    		<?php if ($HomePagePosts->have_posts()) : ?>
    
    			<?php while ($HomePagePosts->have_posts()) : $HomePagePosts->the_post(); ?>
    
    			<?php  if (in_category('4')) : ?>
    				<div class="post" id="post-<?php the_ID(); ?>">
    
    					<div class="entry">
    						<?php the_content('Read the rest of this entry &raquo;'); ?>
    					</div>
    
    				</div>
    				<?php  endif; ?>	
    
    			<?php endwhile; ?>
    
    		<?php else : ?>
    
    			<h2 class="center">Not Found</h2>
    			<p class="center">Sorry, but you are looking for something that isn't here.</p>
    			<?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    		<?php endif; ?>
    
    		</div><!-- fin content-home-left -->
    
    		<div id="content-home-right">
    		<?php
    		$HomePagePosts = new WP_Query();
    		$HomePagePosts->query('cat=3');
    		?>
    
    	<?php if ($HomePagePosts->have_posts()) : ?>
    
    		<?php while ($HomePagePosts->have_posts()) : $HomePagePosts->the_post(); ?>
    
    		<?php  if (in_category('3')) : ?>
    			<div class="post" id="post-<?php the_ID(); ?>">
    
    				<div class="entry">
    					<?php the_content('Read the rest of this entry &raquo;'); ?>
    				</div>
    
    			</div>
    			<?php  endif; ?>	
    
    		<?php endwhile; ?>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    		<?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    	<?php endif; ?>
    
    	</div><!-- fin content-home-right -->
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
  2. alchymyth
    Forum Moderator
    Posted 4 years ago #

    I've been given a theme by my professor

    interesting - what are you studying?

    find out which file is creating that page you are talking about
    http://codex.wordpress.org/Template_Hierarchy

    look into the page's html code in your browser, and find recognizable div ids or classes.

    your code above clearly does not show a third column.

    when you post a link t the site, helping might be easier. otherwise it is all a bit 'theoretical'.

    i am new to php

    don't get intimidated by the php, focus on the html structure behind it.
    ths is more helpful for finding a third column.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags