Support » Plugin: Add Posts to Pages » display horizontally latest posts

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello esse3,

    I am no developer but I did figure out how to create the post horizontal.

    This is a work in progress: http://michaelfeinstein.com/2015/

    Download

    Let me know if this helps.

    kilrain, I looked at your example and that’s what I want to do as well. How did you tweak the plugin? I’d love to get this working for my site.

    Kilrain, please let me know how you did this. What you did is exactly what I am looking to do and I have not yet found a plugin that does it natively. Thank you!

    Hello LindaEve,

    Send me a link so I may review.

    Kilrain

    I cannot send a link because it us currently a development site. Can you tell me how you tweaked the plugin or the css to get the horizontal layout?

    Lindaeve

    Unfortunately it’s not as easy as ‘I did this…’. It’s a combination of modifying the JS and the CSS. Let’s see if you figure it out

    Using the original index.php file, replace from ‘//If there’s an image, add the image to the output’ to ‘//END foreach post returned LOOP’ with the code I have listed below. Then you’ll need to call the <div> and float: left;

    //If there's an image, add the image to the output
    	if($img){
    
    	 $out .= '<div>'
    	 		 .'<a class="" href="' . $permalink . ' ">'
    	 		 .get_the_post_thumbnail($postID, array($size,$size))
    			 .'<'.$h.' class="title"><a href="' . $permalink . '">' . $title . '</a></'.$h.'>'
    	 		 .'</a>'
    			 .'</div>';
    
    	}
    
    	if($full || $readmore){
    
    		//grab all the content of this post
    		$content = $post->post_content;
    
    		//if we're reading more
    		if($readmore){
    			//change the content to only the content before the more break point
    			$more = strpos($content, "<!--more-->");
    			if($more){
    				$content = substr($content, 0, $more);
    			}
    		}
    
    		//format content as needed
    		$content = wpautop(do_shortcode($content));
    		$content = str_replace(']]>', ']]>', $content);
    
    		//formatting for read more
    		if($readmore){
    			$out .= ' <a href="' . $permalink . '" class="readmore">' . $readmore . '</a>';
    		}
    
    		//close the post with a nice <hr>
    		$out .= '</div>';
    		$out .= '<hr style="margin:10px 0">';
    		$out .= '</div>';
    
    	//If NOT full, output either the <li> or <h#> tags & the title of the post
    	} else {
    	}
    
    } //END foreach post returned LOOP
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘display horizontally latest posts’ is closed to new replies.