Forums

Half screen and full screen blocks? (4 posts)

  1. brookie
    Member
    Posted 3 years ago #

    How would I create the half screen and full screen blocks, as seen for example in Brian Gardner's themes, e.g.

    http://www.briangardner.com/themes/church

    Do I need a plug-in to do that or do I need to modify my theme? (I am not using Brian's theme - I'm just looking for the same functionality!)

  2. stvwlf
    Member
    Posted 3 years ago #

    What do you mean by halfscreen block, that there are two columns for part of the display?

    The simplified code is

    <div id="content">  <!--  float: left -->
    
       ---- full width code     (image display) -----
    
       <div class="column">  <!--  left col -->
          ---- code -----
       </div>
    
       <div class="column">   <!-- right column -->
          ---- code -----
       </div>
     -----   more full width code -----
    </div>

    The css for class column includes

    #content .column {
       float: left;
       width: 49%;
    }
  3. brookie
    Member
    Posted 3 years ago #

    Yes, thanks, I mean two columns - left and right.

    The theme I linked to seems to have items matching one category in the left block and another category in the right block.

    Is there a plug-in that will do that for me or do I need to edit code?

  4. stvwlf
    Member
    Posted 3 years ago #

    Hi

    Here is a sample of the loop that you put in each of those columns. $recent is the name of a variable. Use a different variable name in each block. Both will start with a $ cat=1 means include the category that has the category ID #1 showposts means the max # of posts to include

    To find the cat ID, go to the category maint screen - point at the name of the cat - look in the lower left corner at the browser's status line - you will see a URL - the cat ID is at the end of that URL.

    <div class="featured">
       <?php $recent = new WP_Query("cat=1&amp;showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
         <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    	<?php the_content(__('Read the story &raquo;'));?>
       <?php endwhile; ?>
    </div>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags