Shorten amount of title shown???
-
On a foreign page(to WP) I’m importing the titles to a block. As usual, the titles contain links back to their article page. In some cases, the title are so long, it is not attractive to have the whole thing appear on a title list.
I found this code:
<?php $thetitle = $post->post_title; echo substr($thetitle, 0, 26); ?>
but it didn’t work. Was there a particular place I was suppose to insert or some words replaced?
Here is the code I have now that supplies the link:
<table cellpadding="2"> <tr> <td>ENB S&D News</td> </tr> <?php do { ?> <tr> <td><a href="<?php echo $row_try123['guid']; ?>"><?php echo chop($row_try123['post_title']); ?></a></td> </tr> <?php } while ($row_try123 = mysql_fetch_assoc($try123)); ?> </table>
please let me know what works, and how to make it work.
Thank you.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Shorten amount of title shown???’ is closed to new replies.