Forums

[resolved] Hooks vs shortcodes? (5 posts)

  1. mila108
    Member
    Posted 1 year ago #

    I am customizing a child theme within Genesis. What are the cons & pros of using hooks in a theme (ie, Genesis Simple Hooks) vs WordPress shortcodes, from performance and maintenance point of view? Are shortcodes plugins?

    Thanks!

  2. MichaelH
    Volunteer
    Posted 1 year ago #

    Hooks are meant for programmers to be able to execute their code in specific situation.

    Shortcodes are meant to provide the user an easy way to 'invoke' the functionality of a plugin (e.g. putting the shortcode in a post's content and having it display a list of posts in a specific category).

  3. mila108
    Member
    Posted 1 year ago #

    Thanks, Michael. I understand the purpose. I used to program in different environments, but websites/WP/themes environment is new to me. My question was from performance and maintenance point of view... There are situations where a similar functionality is offered through widgets, hooks and shorthands, and I am trying to understand what's best from performance and maintenance point of view?

  4. MichaelH
    Volunteer
    Posted 1 year ago #

    I would guess shortcodes/plugins are slower that hooks.

    As far as maintenance, from an user standpoint shortcodes/widgets would be preferred.

  5. mila108
    Member
    Posted 1 year ago #

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic