A Blog That Only Links to One Blog

The blog looks cool and has separate blog pages but I can only get to one blog unless I know the file names of the blogs and if I'm not me guess what I don't. I don't know shit about this blog except for what I can read on the home page. So lets let the user know what blogs we got because they're the best.

I'll copy the blog snippet HTML from the Bootstrap theme and paste it in under the Featured Blog Jumbotron. I'll add some image placeholders for the images and create a img directory. Now I just replace the dummy content with the blog content in chronilogical order. And I'm still doing it. And I'm still doing it. And I'm still doing it.

That took a while. Now looking at some of the snippets are too long in the preview boxes. And the preview boxes have fixed heights. We need to shorten the snippets. I could just physically shorten some of the snippets. But I don't want to physically shorten each snippet for every new blog. I'm too lazy for that and I ain't about that life. Why do that job myself when I can have PHP do this for me.

Now it's time to go deeper down the rabbit hole. We explored the entrance of the rabbit hole which was conditionals now we are going to create our first function. A function takes an input processes it and gives an output. In this case the input would be the snippet and the output would be the shortened snippet that fits in the box. So I'll create a functions.php file and include it in my index.php.

function snippet($snippet) { return substr($snippet, 0, 100) . "..."; } Now I can use the function to fix the snippets automatically.