• To place code or something on header.php, single.php, or anything else, I can choose between calling template part or shortcode, so, what’s the different between them? It seems interchangeable if I’m not building a plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Template parts means you are loading the part of the file but shortcode means you are running a function with an argument. So some code to be reused the template part can be useful than shortcode since you want to load part of the code everywhere rather than calling a function that will give some output when it is invoked.

    Thread Starter muchmuch11

    (@muchmuch11)

    I just read further about this, each of them have its own “limitations”, with one easier to resolve certain task rather than the other. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘template part vs shortcode’ is closed to new replies.