352 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has sold $10,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+6 more
danharper says

When displaying posts in your WordPress theme, you usually have the same chunk of code in multiple places throughout your theme, and it usually never changes.
For example, you typically have the same code in index.php, archive.php, search.php etc. and even the single.php page contains very similar code.

That doesn’t make any sense at all. A better approach is to include that code in one file, and reference that file in index, archive, search, single etc.: Don’t Repeat Yourself (DRY).

I show how to do this in this screencast for the new Nettuts Screencast Competition

:)

1179 posts
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
mabuc says

Nice idea Dan, This is very useful I will try this on my latest theme.. Thank you for sharing and Good Luck on the competition. :)

1352 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has been part of the Envato Community for over 5 years
  • Has sold $250,000+ on Envato Market
+6 more
fuelthemes says

Are there any cons performance wise?

352 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has sold $10,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+6 more
danharper says
Are there any cons performance wise?

Nope :)

by
by
by
by
by
by