WordPress Get_template_part Tutorial

WordPress Get_template_part Tutorial


In this lesson we learn how to use the “get_template_part()” function to avoid repeating code throughout our theme files. Check out my “Get a Developer Job” course:

To view a complete list of the WordPress lessons in sequential order visit:

Link to download .zip of theme files as shown in this video (note: this is not a “complete” WordPress theme yet and this download is only intended for educational purposes to dissect and review):

Want to share the WordPress website that you’ve been creating on your computer with the world? Learn about the web host I use and how you can get a domain + hosting for .95 a month ( savings):

Sign up for my newsletter to receive periodic webDev tips, tricks, resources and coupons. Join the list at

Follow LearnWebCode on Twitter for resources and updates:

27 Comments

27 Replies to “WordPress Get_template_part Tutorial”

  1. Great tutorial, I remember you asking what ideas we had about future lessons.  Maybe Template on portable device scaling

  2. Thank you so much I have loved your work so much. I am a new designer in wordpress and I have been designing from scratch but nothing is still kind of difficult for me and that is How to make a good styled static home page using an Admin panel. Because currently I use widegets to through information on the home page. I really want to learn how to create a functioning Admin panel in wordpress. Hope you make this video

  3. Thanks for Great tutorial in WP. I want more Tutorial in WP theme . Please upload asap 

  4. i really hope you haven’t simply stopped this series. i know it’s only been a month or so since this last video, but i’m really really hoping for more. i’ve learned more from this series in the past two days than i have from a combination of other resources in the past month. please keep making tutorials, i truly appreciate them, and you for making them.

  5. As a beginner in web programming, I find these videos highly useful. It used to look like a lot of jibberish to me. I hope you decide to continue making more videos! You know a web programming tutorial is good when you don’t fall asleep halfway through.

  6. Great tutorials – Could you please create tutorials on how to create pagenation in wordpress? Please:)

  7. Thanks so much. The highest quality of tutorials I’ve seen, extremely helpful (personal use, as a student and for my job).

  8. after using this code in search page and  in archive page post shows [..] before Read more. How can i remove [..] 

  9. Excellent but think about making a single video of wordpress loops on get_posts( ),get_catogories( ) and get_pages( ), etc. Thanks in advance.

  10. This is the best tutorial I have ever came through. I built a fully functional blog in a couple of hours following your videos! Awesome. Thanks a lot.

  11. Gotta point something out of this video: The main page is displaying full content is it not? Well mine is (I don’t mind it though, because I can use the dashboard items). Lets say if I would only want excerpts in all the pages then the “if” statement should be lightly changed right? I’ve tried to replace “the_content()” to “the_excerpt()” but the Read more button is not displaying :/

  12. Ok. So, I am stuck. I have this code
    post_excerpt) { ?>

    <a href="”>Seguir leyendo»

    BUT homepage doesn’t show the excerpts UNLESS I manually add them. But I want them to be automatically generated. Where’s my error? I think it is in the $post variable (?).

  13. What about your single.php, the only thing different was the link on the article post. How would you conditionally set it?

  14. you have not added it to category.php (but added in archive) but exhibition it on video in the website xd

Comments are closed.