NX WP Theme

Single


Hooks in WordPress allow us to modify or extend WordPress/Theme functionality without altering core files of the theme. We have also included some action hooks in the single of this theme.

Action hooks

Instead of overriding the single.php file, which is located in the root directory of the parent theme if not needed we can use the predefined hooks from nx-theme

  • nx_single_before_content
  • nx_single_after_content

How to use

In order to use the predefined action hooks we need to use add_action function with our own, to call as viewed below. Keep in mind that we can name our function as we please so replace custom_single_message with whatever you like.

function custom_single_message() {
    echo '

Custom message in single.

'; } add_action('nx_single_before_content', 'custom_single_message');