Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Brandon Browning
11,989 PointsI want to know how to include a blog within my html built site, not seperate from the site but as part of the site.
I see many sites that have a blog page within their site. In the navigation of the site they have it listed and it is part of the site. During my searches all I have seen is where people keep saying that you need to build the site with wordpress of something like that. I want to code my site with html and have a blog as part of my site not something outside on its own. Any help on figuring out how developers do this would be very much appreciated.
3 Answers
Liam Maclachlan
22,805 PointsHey there :)
I have coded a few blogs into my sites but it has been done in PHP. You need to be able to access and store blogs on a server so you will also need some mySQL knowledge.
I would really recommend looking at the beginners PHP course as it really does help speed up site coding :)
You will only be able to add new static pages with HTML. This won't create a dynamic blogging website where you can create and store articles from the front end a have them accessible and visible to Joe Public, without recoding the rest of the site.
Since I have done the 'Make your own Wordpress theme' on here, I wouldn't ever go back to making my own CMS again.
I can now create a Wordpress theme from a static HTML template I have created; Awesome!
It was great for gaining experience with PHP, AJAX and Javascript but there are far more practical ways of doing things.
Don't reinvent the wheel; but do help solve the issue of getting a puncture...
In other words, if it is already great, get on board with making in greater :)
Katherine Duncan-Welke
iOS Development with Swift Techdegree Graduate 33,030 PointsThe reason they talk about building the website entirely with WordPress is that you can use it to build out your entire site, then simply dedicate one page to blogging. Within WordPress you can create normal website pages and fill them with whatever content you want, and all you have to do is disable comments on those pages. In the settings you can then choose a page to act as the blog, and that will contain all of your posts.
Coding a blog yourself isn't easy, like Liam said, because you need additional background in other languages. The best you can do in simple html is to imitate a blog layout and use css to create consistent styles that you will use to style each post. That's not the best solution though, because in the end it takes extra work to maintain and consistently adding posts is more time consuming.
What some people do is install WordPress in a subdirectory of their website, and use it solely as a blog. The url might look something like yourwebsite.com/wordpress or yourwebsite.com/blog. If you want to build out the rest of your site in html, this might be the best solution. Your theme for the WordPress blog could then be styled to look like your website if you wish, or it could be entirely different. Depending on your comfort/knowledge level you could start with a default theme first, or do a little WordPress learning and customize a theme yourself. There's a nice blank WordPress theme called underscores that contains default code you can then add to and tweak as you like - I've used it myself and it's a good starting point for creating your own theme. Anyway, I hope that all helps answer your question! :)
Elijah Gartin
13,182 PointsIn addition to what the others have mentioned with WordPress (my number one website option), you can use other CMS platforms out there. One of my friend is a stubborn Ruby programmer and built his own blogging platform using Rails.
The addition of the blog to their navigation is generally just a way that devs attempt to make it seem like a seamless experience albeit they might be utilizing a completely separate environment to for the blog.
I highly recommend you go with what Liam mentioned in taking the WordPress course/courses to learn how to turn your HTML static website into a dynamic WordPress site. It may take more time initially to learn all the ins and outs, but in the end you'll save yourself a lot of time and headaches in maintaining your blog. It's like old Abe said, "Give me six hours to chop down a tree and I will spend the first four sharpening the axe."