Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter ReallyConfused

    (@reallyconfused)

    Ganners, thank you so much, it worked a treat.

    You really helped me out here, hope some good karma comes your way.

    Thread Starter ReallyConfused

    (@reallyconfused)

    Haha, thanks again Ganners, I already thought of that but the problem it that it adds “…” to every title, even if it hasn’t been truncated.

    Thread Starter ReallyConfused

    (@reallyconfused)

    Hi Ganners,

    Thanks for your reply.

    This is more than half way to what I need. I does cut the title off at 35 characters, but fails to add “…” to the end of titles that have been truncated.

    Any ideas?

    Thread Starter ReallyConfused

    (@reallyconfused)

    Hi Rami,

    Thanks for your reply.

    I have just the latest 5 posts in a small section on my main site page, and then a link to the actual blog itself (which is a full page wide, so no need to limit the length here)

    By limiting the author it would mean that the shortened post_title would appear on both pages, and while it would be perfect on the index page, it might look poor on the blog page.

    Thread Starter ReallyConfused

    (@reallyconfused)

    Hi again, just to let you know I got this sorted using 13Ham’s code

    $date = date('m.d.y', strtotime($info['post_date']));

    Thank you very much 13Ham and MichaelH for all your help.

    Thread Starter ReallyConfused

    (@reallyconfused)

    Thanks for your reply again Michael.

    Assuming you are talking about this code being in one of your theme templates

    No, I’m happy with my theme and my theme works great. But the theme index would be located at website.com/blog, as there is more to my site than just the blog. So on the index page of the site (which has no integration with WordPress or my Theme) I would like to list my 5 most recent posts.

    The code I posted above is the exact code from the section of the index page and displays what I need, but is just let down by the formatting of the date.

    I just need to alter the existing code, to format the date.

    I read both of your suggested articles before making my original post and tried some of the suggested methods without success.

    Thread Starter ReallyConfused

    (@reallyconfused)

    Hi Michael, thanks for your speedy reply, I really appreciate it.

    I’ve tried putting your example into my code, but it’s not working, I’m obviously missing something.

    This is my original code:

    <?php
    mysql_connect("*******", "*******", "*******") or die(mysql_error());
    mysql_select_db("*******_*******") or die(mysql_error());
    
    $data = mysql_query("SELECT * FROM wp_posts ORDER BY post_date DESC LIMIT 0, 5") or die(mysql_error()); while($info = mysql_fetch_array( $data ))
    {
    Print "<tr><td width=5></td><td width=988><h3 class='left'><li><a href='website.com/news/?p=".$info['ID'] . "'>".$info['post_title'] . "</a> <font color=#666666><i> - posted on ".$info['post_date'] . "</td></tr>";
    } 
    
     ?>

    Is there any chance you’d be kind enough to show me exactly how the code should look after your example has been implemented?

    Thanks again 🙂

Viewing 7 replies - 1 through 7 (of 7 total)