mhw
Forum Replies Created
Viewing 5 replies - 1 through 5 (of 5 total)
-
Forum: Fixing WordPress
In reply to: Article count on external index.php?Site is http://mintblogs.com =]
Forum: Fixing WordPress
In reply to: Article count on external index.php?Nobody? :'(
Forum: Fixing WordPress
In reply to: Article count on external index.php?Okay guys, I am using this code to display the most recent title on my external page:
<?php require_once('wp-blog-header.php'); $count_posts = wp_count_posts(); $published_posts = $count_posts->publish; ?> <?php query_posts('showposts=1'); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a> <?php endwhile; ?> <?php else : ?> <?php endif; ?>It works a treat! My new problem is that I need to cut down the title so it will fit into the small area I need it to. I did a bit of research and somebody told me to add this code:
echo strlen($text > 125) ? substr($text, 0, 125) . '...' : $text;I haven’t a clue where to add it. Can anyone help?
Thanks guys.
Forum: Fixing WordPress
In reply to: Article count on external index.php?Thanks a million for the code dbmartin! 😀
It’s helped me a great deal =]
Forum: Fixing WordPress
In reply to: Article count on external index.php?Thanks for that, it should really come in useful 🙂
Would you be able to supply me with the code for the most recent too? – If it’s not too much trouble? Just the title of the article would suffice, I have no need for the rest =)
Viewing 5 replies - 1 through 5 (of 5 total)