[resolved] Horizontal marquee "recent posts" (5 posts)

  1. aqdam
    Posted 5 years ago #

    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">
    	$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>';
  2. Michael
    Forum Moderator
    Posted 5 years ago #

    added separator to a foreach list of links:


  3. aqdam
    Posted 5 years ago #

    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.

  4. robertbenge
    Posted 5 years 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!


  5. Sinfullysweet
    Posted 4 years 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?

Topic Closed

This topic has been closed to new replies.

About this Topic