Autor Zpráva
Lili
Profil *
Ahoj, snažím se do Wordpressu našroubovat tuhle šablonu wordpress.org/themes/viper Potřebovala bych v ní ale změnit zobrazování příspěvků. Chci, aby se zobrazovaly vždycky čtyři vedle sebe a pak další řádek tak, jako ty první čtyři, což vidíte na té ukázce. Uměl by mi někdo poradit, jak na to, prosím? Toto by měl být, jak doufám, soubor se šablonou, v níž se to dá změnit, ale jsem bezradná, jak to udělat. Předem děkuji.

<!-- Inner Content Section starts here -->
<div id="inner_content_section">

<?php
if (!of_get_option('show_magpro_slider_home') || of_get_option('show_magpro_slider_home') == 'true'): ?>
<?php
  get_template_part('slider'); ?>
<?php
endif; ?>

<!-- Main Content Section starts here -->
<div id="main_content_section_magten">

<?php
if (have_posts()): ?>
<?php
  $count = 0;
  while (have_posts()):
    the_post();
    $count++; ?>
<?php
    if ($count == 1 || $count == 2 || $count == 3): ?>
<div <?php
      post_class('magtenonefour') ?> id="post-<?php
      the_ID(); ?>">

<div class="magtenonefourimg">
<?php
      if (has_post_thumbnail()) {
        $magthumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID) , 'viperthumb', false, '');
        echo '<img src="' . $magthumb[0] . '" />';
      }
      else {
        echo '<img src="' . get_template_directory_uri() . '/skins/images/750-' . rand(1, 5) . '.jpg" />';
      }
?>
</div>

<div class="magtenonefourcontent">

<h2>
<a href="<?php
      the_permalink(); ?>" title="<?php
      printf(esc_attr__('Permalink to %s', 'viper') , the_title_attribute('echo=0')); ?>" rel="bookmark"><?php
      the_title(); ?></a>
</h2>
<?php
      if (function_exists('the_ratings') && (of_get_option('show_ratings_magten') == 'true')): ?>
<div class="magtenratings">
<?php
        the_ratings(); ?>
</div>
<?php
      endif; ?>
<p><?php
      echo viper_get_limited_string(get_the_excerpt() , 150, '...') ?></p>
<span class="mag_post_excerpt_more"><a href="<?php
      the_permalink(); ?>" title="<?php
      printf(esc_attr__('Permalink to %s', 'viper') , the_title_attribute('echo=0')); ?>" rel="bookmark">Read More</a></span>

</div>

</div>
<?php
    elseif ($count == 4): ?>
<div <?php
      post_class('magtenonefourlast') ?> id="post-<?php
      the_ID(); ?>">

<div class="magtenonefourimg">
<?php
      if (has_post_thumbnail()) {
        $magthumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID) , 'viperthumb', false, '');
        echo '<img src="' . $magthumb[0] . '" />';
      }
      else {
        echo '<img src="' . get_template_directory_uri() . '/skins/images/750-' . rand(1, 5) . '.jpg" />';
      }
?>
</div>

<div class="magtenonefourcontent">

<h2>
<a href="<?php
      the_permalink(); ?>" title="<?php
      printf(esc_attr__('Permalink to %s', 'viper') , the_title_attribute('echo=0')); ?>" rel="bookmark"><?php
      the_title(); ?></a>
</h2>
<?php
      if (function_exists('the_ratings') && (of_get_option('show_ratings_magten') == 'true')): ?>
<div class="magtenratings">
<?php
        the_ratings(); ?>
</div>
<?php
      endif; ?>
<p><?php
      echo viper_get_limited_string(get_the_excerpt() , 150, '...') ?></p>
<span class="mag_post_excerpt_more"><a href="<?php
      the_permalink(); ?>" title="<?php
      printf(esc_attr__('Permalink to %s', 'viper') , the_title_attribute('echo=0')); ?>" rel="bookmark">Read More</a></span>

</div>

</div>
<?php
    else: ?>
<div <?php
      post_class('magtenone') ?> id="post-<?php
      the_ID(); ?>">

<div class="magtenoneimage">
<?php
      if (has_post_thumbnail()) {
        $magthumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID) , 'viperthumb', false, '');
        echo '<img src="' . $magthumb[0] . '" />';
      }
      else {
        echo '<img src="' . get_template_directory_uri() . '/skins/images/750.png" />';
      }
?>
</div>

<div class="magtenonecontent">
<h2>
<a href="<?php
      the_permalink(); ?>" title="<?php
      printf(esc_attr__('Permalink to %s', 'viper') , the_title_attribute('echo=0')); ?>" rel="bookmark"><?php
      the_title(); ?></a>
</h2>
<?php
      if (function_exists('the_ratings') && (of_get_option('show_ratings_magten') == 'true')): ?>
<div class="magtenratings">
<?php
        the_ratings(); ?>
</div>
<?php
      endif; ?>
<p><?php
      echo viper_get_limited_string(get_the_excerpt() , 150, '...') ?></p>
<span class="mag_post_excerpt_more"><a href="<?php
      the_permalink(); ?>" title="<?php
      printf(esc_attr__('Permalink to %s', 'viper') , the_title_attribute('echo=0')); ?>" rel="bookmark">Read More</a></span>
</div>

</div>
<?php
    endif; ?>
<?php
  endwhile; ?>

<?php
  $next_page = get_next_posts_link(__('Previous', 'viper'));
  $prev_pages = get_previous_posts_link(__('Next', 'viper'));
  if (!empty($next_page) || !empty($prev_pages)):
?>
<div class="pagination">
<?php
    if (!function_exists('wp_pagenavi')): ?>
<div class="al"><?php
      echo $next_page; ?></div>
<div class="ar"><?php
      echo $prev_pages; ?></div>
<?php
    else:
      wp_pagenavi();
    endif; ?>
</div><!-- /pagination -->
<?php
  endif; ?>

<?php
else: ?>
<div class="nopost">
<p><?php
  _e('Sorry, but you are looking for something that isn\'t here.', 'viper') ?></p>
</div><!-- /nopost -->

<?php
endif; ?>

</div>
<!-- Main Content Section ends here -->

</div>
<!-- Inner Content Section ends here -->

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0