I’ve found two main ways to add a section on a web page to show shortened sections of posts. The first way is done just using html and css, and can take a little long. The second way is by using javascript to automatically load certain information from posts that are separate files. The javascript method is the more complicated of the two, so I will show that after the html/css method.
The layout for this section will be very similar to the list that I put in the sidebar on the right. The main difference is that instead of having each <li> element be a person, they will each be a post. For example:
<div id=”posts”>
<ul>
<li>
<h2 class=”gold-text”>Lorem Ipsum<h2>
<p class=”sub-logo”>October 28th, 2014</p>
<p>Lorem ipsum dolor sit amet, arcu in porttitor sit etiam nulla, euismod aliquam amet nisl, ligula tempor lobortis placerat condimentum. Montes a, mauris dolor, mauris morbi vestibulum facilisis turpis. Erat tincidunt ut ut tristique integer, velit dui luctus non, donec massa vestibulum justo nisl netus. Ullamcorper fringilla. Quis a, condimentum nibh non vitae, lorem fusce eius etiam, erat nunc tempor aliquam nec in, ac non eget fermentum morbi nostra. Turpis aenean vitae a eros volutpat. Sociis wisi tellus, ac magna fusce, aenean parturient qui vestibulum ut vitae nisl, semper leo faucibus odio lorem…</p>
</li>
</ul>
</div>
This would result in something like this:
You can use the same sort of css as with the list in the sidebar on the right and add more elements and get something like this:
But writing and changing all of that out would be very frustrating if you had to do it often. What if you could have all of that copying done with just one line of code though? Next week: javascript.



