• 07-07-2017, 21:35:05
    #1
    <?php if($mts_options['mts_related_posts'] == '1') { ?>
    <?php $categories = get_the_category($post->ID); if ($categories) { $category_ids = array(); foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id; $args=array( 'category__in' => $category_ids, 'post__not_in' => array($post->ID), 'showposts'=>4, 'ignore_sticky_posts'=>1, 'orderby' => 'rand' );
    $my_query = new wp_query( $args ); if( $my_query->have_posts() ) { $counter = 0;
    echo '<div class="related-posts"><div class="postauthor-top"><h3>'.__('Benzer Yazılar','op').'</h3></div><ul>';
    while( $my_query->have_posts() ) { ++$counter; if($counter == 2) { $postclass = 'last'; $counter = 0; } else { $postclass = ''; } $my_query->the_post(); ?>
    <li class="<?php echo $postclass; ?>">
    <a rel="nofollow" class="relatedthumb" href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title(); echo '<br></br> <br/>'; ?>">
    <span class="rthumb">
    <?php if(has_post_thumbnail()): ?>
    <?php the_post_thumbnail('widgetthumb', 'title='); ?>
    <?php else: ?>
    <img src="<?php echo get_template_directory_uri(); ?>/images/smallthumb.png" alt="<?php the_title(); ?>" width='85' height='65' class="wp-post-image" />
    <?php endif; ?>
    </span>
    <span class="related_title">
    <?php the_title(); ?>
    </span>
    </a>
    <span class="related_theauthor"><?php _e('by ','op'); the_author_posts_link(); ?></span>
    </li>
    <?php } echo '</ul></div>'; }} wp_reset_query(); ?>

    S.a arkadaşlar.
    Sıkıntım şu.2 satır ve 2 sutundan oluşuyor.ama satırlar alt alta gelince yapışık oluyor. satırlarda, sutunlar arası boşluk kadar birbirinden ayrı olmasını istiyorum.
  • 07-07-2017, 22:12:54
    #2
    Yapmak istediğinizi tam anlayamadım ama, alt alta gelenlerin arasında boşluk olmasını istiyorsanız css dosyasına aşağıdaki gibi bir kod ekleyebilirsiniz.

    .related-posts ul li:not(:last-child) {
    margin-bottom:10px;
    }
  • 07-07-2017, 22:54:29
    #3
    xFactoria adlı üyeden alıntı: mesajı görüntüle
    Yapmak istediğinizi tam anlayamadım ama, alt alta gelenlerin arasında boşluk olmasını istiyorsanız css dosyasına aşağıdaki gibi bir kod ekleyebilirsiniz.

    .related-posts ul li:not(:last-child) {
    margin-bottom:10px;
    }
    .related-posts {

    padding-bottom: 31px;
    background-color: #FFF;
    margin-top: 30px;
    margin-bottom:10px;

    clear: both;
    float: left;
    width: 93.6%;
    padding: 0 3.1% 3.1%;
    box-shadow: 0px 0px 1px rgba(5, 5, 5, 0.25);
    }
    bu şekilde css de mevcut neresini değiştireyim hocam
  • 07-07-2017, 23:02:59
    #4
    Verdiğiniz koddaki bölüm komple bütün kategorinin benzer yazılarından sonra boşluk bırakır, benim verdiğimi bu kodun altına ekleyip bir deneyin o şekilde her benzer yazının altına boşluk bırakmış olacaksınız.Birebir göremediğim için çok net şeyler söyleyemiyorum.

    .related-posts {
    padding-bottom: 31px;
    background-color: #FFF;
    margin-top: 30px;
    margin-bottom:10px;
    clear: both;
    float: left;
    width: 93.6%;
    padding: 0 3.1% 3.1%;
    box-shadow: 0px 0px 1px rgba(5, 5, 5, 0.25);
    }
    .related-posts ul li:not(:last-child) {
    margin-bottom:10px;
    }
  • 07-07-2017, 23:05:05
    #5
    xfactoria hocam başka türlü halletsemde yardım için teşekürler.
    r10+ verdim