Recent Topics

1 Jun 27, 2004 16:47    

Hello!
I'm new to all of the template things and that with b2, and b2 evolution, and I have no idea how to make it so that each time I blog, each of the sections of the blog are in different divs?? I know it sounds weird, but here's how I make my divs:

<div id="header">
blah blah blah
</div>
<div id="entry">
blah blah blah
</div>
<div id="footer">
blah blah blah 
</div>


Is there anyway to make it so they're like that in every post? And fi you can, where do I go to edit it to make it to do that? Thanks!!
Sincerely,
Eddie.

2 Jun 27, 2004 17:04

Find this piece of code in your _main.php in the folder of whatever skin is bing used. Then change and add divs however u like.

<?php // ------------------------------------ START OF POSTS ----------------------------------------
	if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post

	if( isset($MainList) ) while( $Item = $MainList->get_item() )
	{
		$MainList->date_if_changed();
	?>
	<div class="bPost" lang="<?php $Item->lang() ?>">
		<?php
			locale_temp_switch( $Item->locale ); // Temporarily switch to post locale
			$Item->anchor(); // Anchor for permalinks to refer to
		?>
		<div class="bSmallHead">
		<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><img src="img/icon_minipost.gif" alt="Permalink" width="12" height="9" class="middle" /></a>
		<?php
			$Item->issue_time();
			echo ', ', T_('Categories'), ': ';
			$Item->categories();
			echo ', ';
			$Item->wordcount();
			echo ' ', T_('words'), ' &nbsp; ';
			locale_flag( $Item->locale, 'h10px' );
		?>
		</div>
		<h3 class="bTitle"><?php $Item->title(); ?></h3>
		<div class="bText">
			<?php $Item->content(); ?>
			<?php link_pages() ?>
		</div>
		<div class="bSmallPrint">
			<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>" class="permalink_right"><img src="img/chain_link.gif" alt="<?php echo T_('Permalink') ?>" width="14" height="14" border="0" class="middle" /></a>

			<?php $Item->feedback_link( 'comments' ) // Link to comments ?>
			<?php $Item->feedback_link( 'trackbacks', ' &bull; ' ) // Link to trackbacks ?>
			<?php $Item->feedback_link( 'pingbacks', ' &bull; ' ) // Link to trackbacks ?>

			<?php $Item->trackback_rdf() // trackback autodiscovery information ?>
		</div>
                                   . . . . . . . encludes. . . . . .  	
				</div>
<?php } // ---------------------------------- END OF POSTS ------------------------------------ ?>

the content of each post is called here:

<?php $Item->content(); ?> 

anything above i guess u would call the header and anything below would be the footer and <div>'ed accordingly.

3 Jun 27, 2004 17:09

Oh ok. thank you,I think I understand it. Lol.

4 Jun 27, 2004 19:47

The pieces of code that display with each post go between the loop, which is:

<?php // ------------------------------------ START OF POSTS ----------------------------------------
   if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post

   if( isset($MainList) ) while( $Item = $MainList->get_item() )
   {
      $MainList->date_if_changed();
   ?> 

and:

<?php } // ---------------------------------- END OF POSTS ------------------------------------ ?>

But you don't want to put any <div id="whatever"> in the loop, since id's should be used to reference a unique item on the page, a menu for example, so using this will make your code invalid. You should use <div class="whatever"> instead.


Form is loading...