Wsparcie » Wtyczki » Karuzela postów- wielkość obrazów

  • lukas3123

    (@lukas3123)


    Witam,

    Używam post carusel. Jednak obrazy wpisów maja różną wielkość (długość). Można ustawić jeden rozmiar długości?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Nikodemsky

    (@nikodemsky)

    Dla wysokości max-height, a dla szerokości max-width.

    Thread Starter lukas3123

    (@lukas3123)

    Gdzie to wpisać w kodzie?

    php function thb_postcarousel( $atts, $content = null ) {
    $atts = vc_map_get_attributes( 'thb_postcarousel’, $atts );
    extract( $atts );

    ob_start();
    switch($style) {
    case 'style1′:
    $style_class = 'featured-style4′;
    break;
    case 'style2′:
    $style_class = 'featured-style5′;
    break;
    case 'style3′:
    $style_class = 'featured-style6′;
    break;
    }
    $pagi = ($pagination == 'true’ ? 'true’ : 'false’);
    $nav = ($navigation == 'true’ ? 'true’ : 'false’);

    $args = array(
    'nopaging’ => 0,
    'post_type’=>’post’,
    'post_status’ => 'publish’,
    'ignore_sticky_posts’ => 1,
    'no_found_rows’ => true,
    'suppress_filters’ => 0
    );
    if ($offset) {
    $args = wp_parse_args(
    array(
    'offset’ => $offset,
    )
    , $args );
    }
    if ($source == 'most-recent’) {
    $excluded_tag_ids = explode(’,’,$excluded_tag_ids);
    $excluded_cat_ids = explode(’,’,$excluded_cat_ids);
    $args = wp_parse_args(
    array(
    'showposts’ => $item_count,
    'tag__not_in’ => $excluded_tag_ids,
    'category__not_in’ => $excluded_cat_ids
    )
    , $args );
    } else if ($source == 'by-category’) {
    if (!empty($cat)) {
    $cats = explode(’,’,$cat);
    $args = wp_parse_args(
    array(
    'showposts’ => $item_count,
    'category__in’ => $cats
    )
    , $args );
    }
    } else if ($source == 'by-id’) {
    $post_id_array = explode(’,’, $post_ids);

    $args = wp_parse_args(
    array(
    'post__in’ => $post_id_array,
    'showposts’ => 99
    )
    , $args );
    } else if ($source == 'by-tag’) {
    $post_tag_array = explode(’,’, $tag_slugs);

    $args = wp_parse_args(
    array(
    'showposts’ => $item_count,
    'tag_slug__in’ => $post_tag_array
    )
    , $args );
    } else if ($source == 'by-share’) {

    $args = wp_parse_args(
    array(
    'showposts’ => $item_count,
    'meta_key’ => 'thb_pssc_counts’,
    'orderby’ => 'meta_value_num’
    )
    , $args );
    } else if ($source == 'by-author’) {
    $post_author_array = explode(’,’, $author_ids);

    $args = wp_parse_args(
    array(
    'showposts’ => $item_count,
    'author__in’ => $post_author_array
    )
    , $args );
    }
    $posts = new WP_Query( $args );
    if ( $posts->have_posts() ) { ?>
    <div class=”slick <?php echo $style_class; ?><?php if($pagi == 'true’) { ?> dark-pagination bottom-margin<?php } ?> <?php echo ($style == 'style3′ && $nav == 'true’) ? 'outset-nav’ : ”; ?> <?php echo ($style == 'style3′) ? 'mini-columns’ : ”; ?>” data-center=”<?php echo ($style == 'style3′) ? 'false’ : 'true’; ?>” data-columns=”<?php echo $columns; ?>” data-pagination=”<?php echo $pagi; ?>” data-navigation=”<?php echo $nav; ?>”>
    <?php while ( $posts->have_posts() ) : $posts->the_post(); ?>
    <?php if ($style == 'style1′) {?>
    <article class=”post featured-style4″>
    <?php the_post_thumbnail(’thevoux-single’); ?>
    <div class=”featured-title”>
    <aside class=”post-meta cf”><?php the_category(’, ’); ?></aside>
    <div class=”post-title”>
    <h3>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h3>
    </div>
    <div class=”post-excerpt”>
    <?php echo thb_excerpt(100); ?>
    ” title=”<?php the_title_attribute(); ?>” class=”more”><?php _e(’Read More →’, 'thevoux’ ); ?>
    </div>

    </div>
    </article>
    <?php } else if ($style == 'style2′) {?>
    <div class=”columns”>
    <article class=”post featured-style5″>
    <figure class=”post-gallery”>
    ” title=”<?php the_title_attribute(); ?>”><?php the_post_thumbnail(’thevoux-single’); ?>
    </figure>
    <div class=”post-title”>
    <h5>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h5>
    </div>
    <div class=”post-excerpt”>
    <?php get_template_part( 'inc/postformats/post-just-shares’ ); ?>
    </div>
    </article>
    </div>
    <?php } else if ($style == 'style3′) {?>
    <div class=”columns”>
    <article class=”post featured-style5″>
    <figure class=”post-gallery”>
    ” title=”<?php the_title_attribute(); ?>”><?php the_post_thumbnail(’thevoux-single’); ?>
    </figure>
    <div class=”post-title text-center”>
    <h5>” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h5>
    </div>
    </article>
    </div>
    <?php } ?>
    <?php endwhile; ?>
    </div>
    <?php }
    $out = ob_get_contents();
    if (ob_get_contents()) ob_end_clean();
    return $out;
    }
    add_shortcode(’thb_postcarousel’, 'thb_postcarousel’);

    Nikodemsky

    (@nikodemsky)

    Powinieneś raczej spojrzeć na CSS od wtyczki.

    Thread Starter lukas3123

    (@lukas3123)

    Nie pomogło.

    Zmieniłem jak poniżej:

    Carousel
    */
    /* Slider */
    .slick {
    max-width: 500px;
    max-height: 450px;
    position: relative;
    overflow: hidden;
    }
    .slick:after {
    margin: 0;
    max-width: 500px;
    max-height: 450px;
    left: 0;
    top: 0;
    bottom: auto;

    .slick.slick-initialized {
    height: auto;
    overflow: visible;

    .slick-slide {
    float: left;
    position: relative;
    max- height: 450px;
    min-height: 1px;
    display: none;
    }
    [dir=”rtl”] .slick-slide {
    float: right;
    }
    .slick-slide img {
    display: block;
    max-width: 500px;
    max-heigh: 450px;

    Thread Starter lukas3123

    (@lukas3123)

    mimo zmiany na serwerze ftp, po kliknięcu na img karuzeli postów nadal wyświetla

    .slick-slide img {
    display: block;
    width: 100%;

    Nikodemsky

    (@nikodemsky)

    Przywróć standardowy CSS i podaj adres strony.

    Thread Starter lukas3123

    (@lukas3123)

    nazwa.pl

    Nikodemsky

    (@nikodemsky)

    .slick-slide {
        max-height: 390px !important;
    }
    Thread Starter lukas3123

    (@lukas3123)

    nie działa.

    Dodałem to i nie działało. Usunąłem reszte i zostawiłem tylko to i tez nie działa.

    Nikodemsky

    (@nikodemsky)

    Musi działać, dodajesz do złego arkusza albo w nieprawidłowy sposób.

    Zainstaluj wtyczkę WP add custom css i w niej dodaj podany kod.

    Thread Starter lukas3123

    (@lukas3123)

    działa. wielkie dzięki.

    Thread Starter lukas3123

    (@lukas3123)

    jednak nie działa… „rozjechało się” zarówno karuzela postów jak i na dole suwak postów…

    Thread Starter lukas3123

    (@lukas3123)

    jest..musialem dodac calosc slick slide a nie tylko w/w

    Nikodemsky

    (@nikodemsky)

    Moment… ty mówisz o tym sliderze na samej górze, czy na dole?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Temat ‘Karuzela postów- wielkość obrazów’ jest zamknięty na nowe odpowiedzi.