Forum portalu Fan-Strefa.pl Forum portalu Fan-Strefa.pl 

Autor Wątek: Dwa rzędy notek  (Przeczytany 1420 razy)

szymon

  • Nowicjusz
  • *
  • Wiadomości: 66
  • Reputacja: 3
    • Zobacz profil
    • UltraMadonna.com
Dwa rzędy notek
« dnia: 12 Listopad 2010, 20:28:47 »
Od wczoraj koduję nowy szablon na swoją stronę o Madonnie. Już praktycznie skończyłem, ale nie mogę się uporać z jedną rzeczą. Mianowicie, postanowiłem zrobić schemat newsów na podstawie motywu ALogo. Skopiowałem i przerobiłem strukturę i css, ale notki zamiast ustawić się obok siebie....wariują.
Cytuj
/* block */
.block{   width: 303px; padding-top: 10px; padding-bottom:10px;background:none; margin: 0; position: relative;}
.odd-block{   float: left; padding-left:15px;}
.even-block{ float: right; padding-right:20px;}
.block-content{padding:5px;color:#8e8e8e;}
Cytuj
      <td VALIGN="top" style="background-image:url('<?php bloginfo('template_url'); ?>/images/tlo_03.png');">


            <div class="mainbody"><!--main body-->
            <?php if (is_home() && !is_paged()) {?>
               <div class="postwrapper">
                  <?php   
                        if(get_option('sticky_posts')){
                           $sticked_post=get_option('sticky_posts');
                           $the_query = new WP_Query('showposts=1&p=' . $sticked_post[0]);
                        }
                        else {
                           $the_query = new WP_Query('showposts=1');
                        }
                        if ($the_query->have_posts()) :
                           while ($the_query->have_posts()) :
                              $the_query->the_post();
                              $do_not_duplicate = $post->ID;
                  ?>
                  <div class="post">
                  <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title();?></a></h1>
                     <div class="post-info">Napisał <?php the_author(); ?> | <?php the_time('l, d/m/Y'); ?> | <?php comments_popup_link('Skomentuj', 'Skomentuj (1)', 'Skomentuj (%)'); ?></div>
                              <?php the_content(); ?>
                              Kategorie: <i><?php the_category (', ')?></i>
 <br><br>
                     <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
   
                  </div>      
                  <br><br>

                  <?php
                           endwhile;
                        else:
                           echo("<h2 class='center'>No posts found.</h2>");
                        endif;
                  ?>
               </div>
            <?php    } // end of first if ?>   
            
            <?php
               global $do_not_duplicate;            
               $con = 0;
               if (have_posts()) : while (have_posts()) :
                  the_post();
                  if  ( $post->ID == $do_not_duplicate ) { continue; update_post_caches($posts); }
                  $con++;
                  if( ($con % 2) == 1 ) $myclass = ' odd-block';
                  else $myclass = ' even-block';
            ?>

               <div class="block<?php echo $myclass; ?>">

                     <table id="Table_01"  border="0" cellpadding="0" cellspacing="0">
   <tr>
      <td colspan="2">
         <img src="<?php bloginfo('template_url'); ?>/images/nota2_01.png" alt=""></td>
   </tr>
   <tr>
      <td colspan="2" VALIGN="top" style="background-image:url('<?php bloginfo('template_url'); ?>/images/nota2_02.png');">
<div class="post-title"><h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title();?></a></h1></div>
                     <div style="padding-left:5px;"class="post-info">Napisał <?php the_author(); ?> | <?php the_time('l, d/m/Y'); ?> | <?php comments_popup_link('Skomentuj', 'Skomentuj (1)', 'Skomentuj (%)'); ?></div>

                     <div class="block-content">
                        <?php if (catch_that_image()){?>
                           <div class="post-image">
                              <?php if(get_option('ALogo_timthumb') != 'no') {?>
                                 <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo catch_that_image(); ?>&w=275&h=120&zc=1">
                              <?php } else { ?>
                                 <img class="post-image-thumbnail"src="<?php echo catch_that_image(); ?>" />
                              <?php }?>
                           
                           </div>
                        <?php }?>   
                        <div style="text-align:justify;">
                        <?php the_excerpt(); ?>
                        </div>
                              Kategorie: <i><?php the_category (', ')?></i>
                     
                           </tr>
   <tr>
      <td>
         <img src="<?php bloginfo('template_url'); ?>/images/nota2_03.png" alt=""></td>
      <td>
         <a href="<?php the_permalink() ?>"><img border="0"  src="<?php bloginfo('template_url'); ?>/images/nota2_04.png" width="81" height="71" alt=""></a></td>
   </tr>
</table>
                     </div>
               </div>


               <?php if(!($con % 2) == 1) { ?><div class="clear"></div><?php } ?>
            <?php endwhile; ?>
            <div class="clear"></div>
            <div class="navigation">
               <div class="alignleft">
                     <?php next_posts_link('&laquo; Starsze wpisy') ?>
               </div>
               <div class="alignright">
                     <?php previous_posts_link('Nowsze wpisy &raquo;') ?>
               </div>
            </div>
            <?php endif; ?>
            </div>

                              

      </td>
Jeżeli ktoś wie, co może być przyczyną tego błędu, byłbym wdzięczny za pomoc.
« Ostatnia zmiana: 16 Grudzień 2010, 14:56:32 wysłana przez szymon »

Evan

  • VIP
  • Fan Strefowicz
  • *****
  • Wiadomości: 1954
  • Reputacja: 35
    • Status GG
    • Zobacz profil
Odp: Dwa rzędy notek
« Odpowiedź #1 dnia: 12 Listopad 2010, 21:18:03 »
dodaj może do css position:inline; w tych 2 blokach które mają być obok siebie

szymon

  • Nowicjusz
  • *
  • Wiadomości: 66
  • Reputacja: 3
    • Zobacz profil
    • UltraMadonna.com
Odp: Dwa rzędy notek
« Odpowiedź #2 dnia: 12 Listopad 2010, 21:37:06 »
Dodałem. Niestety, nie pomogło  :(

Forum portalu Fan-Strefa.pl

Odp: Dwa rzędy notek
« Odpowiedź #2 dnia: 12 Listopad 2010, 21:37:06 »