Lines below image php

前端 未结 1 1830
一生所求
一生所求 2021-01-25 00:55

I\'m trying to display one line of excerpt from posts beneath the images at the bottom of this website: http://www.wha2wear.com/ This is the php function used to get the images

相关标签:
1条回答
  • 2021-01-25 00:59

    Your problem is that your display is dependent on the data. A blurb starting with <br> or <p> will wrap, otherwise not. Wrap them in divs to make them line up properly:

    <div id="imageDiv"><a href="<?php the_permalink(); ?>"><?php getImage('1'); ?></a></div>
    
    <div id="blurbDiv"><a href="<?php the_permalink(); ?>"><?php echo limit_words(get_the_excerpt(), '6');
            echo '...</a>';
            echo '</li>'; ?></a></div>
    

    You could also just force a line break between the two:

    <a href="<?php the_permalink(); ?>"><?php getImage('1'); ?></a>
    <br />
    <a href="<?php the_permalink(); ?>"><?php echo limit_words(get_the_excerpt(), '6');
            echo '...</a>';
            echo '</li>'; ?></a>
    
    0 讨论(0)
提交回复
热议问题