• i have made a function.php file and i want post in columns and thumb nails to appear small

    /*** Custom Loop ***/
    
    function Last5posts()
    {
        $args = array( "showposts" => 5 );
        query_posts($args);
    
        $content = "";
    
        if( have_posts() ) : 
    
            while( have_posts() ) :
    
                the_post();
                $link = get_permalink();
                $title = get_the_title();
                $date = get_the_date();
                $thumbnails =get_the_post_thumbnail();
              $excerpt= get_the_excerpt();               
    
                $content .= "<div style='padding: 5px; border: 1px solid red'>";
                $content .= "<h3><a href='$link' target='_top'>$title / $date / $thumbnails</a></h3>\n";
                $content .= "<p class='excerpt'>" . get_the_excerpt() . "</p>";
                $content .= "</div>";
    
            endwhile;
    
            wp_reset_query();
    
        endif;
    
        // Leave one line commented out depending on usage
        echo $content;   // For use as widget
        //return $content; // for use as shortcode
    }
    add_shortcode('Last5Posts', 'Last5posts' );
  • The topic ‘Align Posts in a Row [Posts in Columns ] and make thumbnail Small’ is closed to new replies.