PHP! How to insert if function? Or better using another solution?
Question:Because there isn't enough space for the whole title the title has to be cut but this code creates a second line if the last displayed word* is too long.PHP Code:
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php echo thman_get_limited_string($post->post_title,13); ?></a>
Example 1
Whole title: 12345 123456 12345678* 12345678 1234567890
(2 Lines)
12345 123456
12345678*...
Example 2
hole title: 123 123456 123456 12345678 1234567890
(1 Line)
123 123456 123456...
How can I change the code to insert a <br /> if I get Example 2? And if I get Example 1 then a <br /> shouldn't be inserted.
Solution?
Whole title: 12345 123456 12345678* 12345678 1234567890
(2 Lines)
12345 123456
12345678*...
Solution 2
hole title: 123 123456 123456 12345678 1234567890
(1 Line)
123 123456 123456...
<br />
-
Tim Franklin -
Thanks - 1 reply
SignatureBitcoin | Crypto | Blockchain Secrets |{{ DiscussionBoard.errors[3177520].message }}-
tgma -
Thanks - 1 reply
{{ DiscussionBoard.errors[3177732].message }}-
Ambius -
Thanks
{{ DiscussionBoard.errors[3184128].message }} -
-
-