• 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(); ?>
Viewing 1 replies (of 1 total)
  • 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
    https://codex.www.ads-software.com/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.

Viewing 1 replies (of 1 total)
  • The topic ‘3 colums display’ is closed to new replies.