0

カスタム テーマを使用しており、タイトルを 2 行目に折り返す方法を見つける必要があります。テーマにはカルーセルがあり、タイトルが下に表示されます。現時点では、タイトルが長すぎる場合は、後に「...」を付けます。これを停止して、代わりに 2 行目に折り返すにはどうすればよいですか?

これはテーマのコードです

<div class="home-carousel">
  <ul>
    <?php
    $carimgheight = 120;
    if ( get_option('storefront_carousel_img_height' )) {$carimgheight = get_option('storefront_carousel_img_height' ); }
    $carimgwidth = 200;
    if ( get_option('storefront_carousel_img_number' ) == 2 ) {$carimgwidth = 428;}
    if ( get_option('storefront_carousel_img_number' ) == 3 ) {$carimgwidth = 276;}
    if ( get_option('storefront_carousel_img_number' ) == 5 ) {$carimgwidth = 154;}
    if ( get_option('storefront_carousel_img_number' ) == 6 ) {$carimgwidth = 124;} 
    //BEGIN Slider LOOP
    $loopcarousel = new WP_Query( array( 'post_type' => 'carousel' ) );
    while ( $loopcarousel->have_posts() ) : $loopcarousel->the_post();
    $buttonlink = get_post_meta($post->ID, "link", true);
    if(has_post_thumbnail()) {
    $carthumb = get_post_thumbnail_id(); 
    $carimage = vt_resize( $carthumb, '', $carimgwidth, $carimgheight, true );
    }
    ?>
        <li>
            <a href="<?php echo $buttonlink; ?>" title="<?php the_title(); ?>"><img alt="<?php the_title(); ?>" title="<?php the_title(); ?>" src="<?php echo $carimage['url']; ?>" width="<?php echo $carimage['width']; ?>" height="<?php echo $carimage['height']; ?>" /><?php if ( get_option('storefront_carousel_image_only') == "false" ) { ?><p><span class="carousel-title"><?php echo the_title(); ?></span></p><?php } ?></a>
        </li>
    <?php endwhile; //END SLIDER LOOP ?>

  </ul>
4

1 に答える 1