DEV Community

Cover image for Wordpress get_template_part() is just great
elbasiri
elbasiri

Posted on

Wordpress get_template_part() is just great

Hi there, this is my first post here!

I am currently a WordPress developer from Morocco based in the capital.

During my work on an agency website, I found a great use case for the template's part functions in WordPress, and I wanted to share it with you.

While wandering in the Figma file, I stumbled upon some pages that have alike blocks just used in different orders and with different content, so I thought the fastest and most efficient way was to create templates for each block and then use them on all pages like the components in modern JS frameworks, and it worked out great. The content is based on the page I am in, but the code is clean and organised and fast this way.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay