How to align UL items on the same line?

1

The slider in this link: link was with the indicators (items of the UL) aligned, but when I will configure to stay dynamic with wordpress, adding the template tags, they misaligned, staying one above the other.

<?php 

                    $posts_slides = new WP_Query (array(

                        'category_name' => 'Destaques',
                        'posts_per_page' => 3
                    ));

                    $n = 0;
                    while($posts_slides->have_posts()) : $posts_slides->the_post();

                    ?>


                <ul class="nav nav-pills nav-justified">
                    <li data-target="#myCarousel" data-slide-to="<?php echo $n ?>">
                        <a href="#">
                            <?php the_title(); ?>
                        </a>
                    </li>


                </ul>

                <?php $n++; endwhile; wp_reset_postdata(); ?>

I have tried to inspect all elements trying to get a solution in CSS and have not found it. It may be that with different eyes the solution is found. Thanks in advance for your help.

    
asked by anonymous 28.12.2017 / 01:28

1 answer

1

Error 1. You are repeating ul in your loop.

  • Solution. Repeat only li in your loop

Error 2. You are using diplay: table in css.

  • Solution: You can use, diplay: inline or flexbox to resolve this issue.
28.12.2017 / 14:13