Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in the docs? How to place some plugin output in the header?
#1
The documentation page states that header is a front-end hook that is called in the head section of the page. I create a simple plugin and registered it to that hook but the output is shown in the back-office not in the front-office.

No output is generated in the front-office. I need to generate output in every page header in the front-end.

Also, are there any more docs? At least better descriptions to what the registration? I see plugin types as "theme", others as "template" or "plugins", what are the differences? How does it affect the plugin?
Rejoice! For very bad things are about to happen.
Reply
#2
Oh, and I do understand that the way GS works right now doesn't allow for such a plugin to function. But the documentation should be corrected.
Rejoice! For very bad things are about to happen.
Reply
#3
Hi,

Your right , it should be called "theme-header"

And it will only get called if your have

<?php get_header(); ?>

somewhere in the <head> section of your template files.

You can also just create your own hooks anywhere in your templates.

just use

<?php exec_action('your-hook-name'); ?>

Then just register you plugin with your hook name.
My Github Repos: Github
Website: DigiMute
Reply
#4
I'm actually just calling the function I need, it's easier and faster considering what I currently have, thanks for the reply.

My main point is really about documentation, it's getting a bit outdated, or so it seems Smile
Rejoice! For very bad things are about to happen.
Reply
#5
Not getting outdated. It's just a recent error in latest update of these docs.

Two months ago I suggested Chris to make 2 separated lists of plugins, backend and frontend ones (before that, they were mixed), but apparently he had some cut-paste error, and no one realised till now. :-)

So:
- theme-header and theme-footer should be in FRONT-END list.
- header and footer should be in BACK-END list.

EDIT: These errors have been fixed.
Reply




Users browsing this thread: 1 Guest(s)