Hello,
this following code displays a basic horizontal marquee for the 5 recent posts. I would like that the titles are seperated by a space and a symbole of my choice. exaple: "title1 | title2 | title3...".
I hope you could help with this. I googled to find a ready marquee but I didn't find anyone. I think many would use it a the head of the page. and it is so attractive like as a slideshow.
<marquee behavior="scroll" direction="right">
<h2>
<?php
$args = array( 'numberposts' => '5');
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $post ){
echo '<a href="' . get_permalink($post["ID"]) . '" title="Look '.$post["post_title"].'" >'. $post["post_title"]. '</a>';
}
?>
</h2>
</marquee>
added separator to a foreach list of links:
http://pastebin.com/HT3HwPED
Thanks very much. It is working. It was originally a list, but it works also as a scrolling marquee. I putted it above the mainpage. So, anyone who want a scrolling marquee he can use this.
I tested other possibilities, and it seems that it works when i add a symobol in the echo line before the <a... and after the /a>, to get title between << >> as example.
robertbenge
Member
Posted 1 year ago #
This is great, thanks!
I would like to show the latest post from one category, and then the latest post from a second category so it would be like
New Category1 Post: Post1 title | New Category2 Post: Post2 Title
I can't work it out though!
Thanks.
Sinfullysweet
Member
Posted 6 months ago #
This is what I have been looking for. I love what you have done, but wonder one thing. How can I get the featured image to pull up associated with that post?