• Yeah so this little thing has been driving me mad now :/

    All i want is a shorter title, i got some “lastest posts” in the side column, its just i only want each post title to fill around 20 words and thereby 1 line i’ve tryid with the substr funktion but it didnt work out :/

    like
    TITLE LINK GOES HE..
    TITLE LINK GOES HE..
    TITLE LINK GOES HE..

    I’ve search around and cant find anyone mention this, only about cutting of the content.. but i just wanna cut of the title or shorten it if you want :/

Viewing 2 replies - 1 through 2 (of 2 total)
  • https://www.totallyphp.co.uk/code/shorten_a_text_string.htm

    Google amazes me ??

    … and that does work, your just not using it properly, or in the right place. One or both of the two.

    Thread Starter froggystone

    (@froggystone)

    yeah ok let me specify it a bit :/

    if (is_home()) {

    $myposts = get_posts(‘numberposts=10&offset=1’);
    foreach($myposts as $post) :
    ?>

    “>
    (this line doesnt work)<?php substr(the_title(), 0, 15);?>

    <?php endforeach; }?>

    I’ve tryid to put the_title into a $ like $t = the_title()

    But i guess u cant put a fucktion inside a varible

    what you refur to is pretty much what i’ve already done, he has also writen it into a funktion :/

    but well gonna try a bit and see what im gonna end up with ( probely some bruses from banging my head down the keyboard)

    Anyway this should be pretty simple, im just a bit rusty ?? would be nice if someone could just work out that tiny little line ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cut Of Title’ is closed to new replies.