Issue installing plugin

I am facing an issue. my plugin is installed and enabled perfectly. but not working.

Can you go into a little more detail? What plugin are you trying to install, and what steps have you taken so far?

I am creating a custom header plugin. But its not working
My installation javascript coding is done.

How can I enable my plug in. I didnt get where is the issue.

If you’re creating a custom one then you may want to go into even more detail about what you’re attempting to do. Is this on a dev install, or a live site? Do you know the plugin works?

this is a dev install

This is my plugin (3.5 KB)
this is my plugin

Can you explain what you want to achieve with your plugin?
Did you consider creating a theme component, unless you need to have access to or do things for which a plugin is mandatory?

Ya I want a plugin that will create a custom header for me.

What features do you need? How will the header be customized? Can you be more detailed in your explanations so we can help better?

I cant make changes in the theme component I want a custom plugin for perform this.

I want a header like this.

You should only need a plugin if you are changing the API.

What here requires changes to the API?

If there are no changes to the API, a Theme Component should suffice.

But I want a plugin for this task. My plugin is not working. its installed and loaded successfully. but still its not working.

Why? There are no advantages to using a plugin for this task (as far as I’m aware). Theme Components are quicker and easier to install and update.

Ya I know. But is it not possible to create a plugin for this.

It is, but it’s not the best approach, that’s all.

Ya I know this is not the best approach. But I want to create a plugin.
kindly help me to debug it.

You’re trying to use a sledgehammer to crack a nut.

There is no need for a plugin, you can execute Javascript from a theme component, which is more easy.

There is no need for Javascript if you’re just writing out HTML to your header, you can just add it in Common - Header in your theme component.

Please share this code on GitHub or equivalent if at all possible, so we don’t have to download a file or collection of files from the internet in order to inspect and comment.

1 Like

Ya sure I am adding the code in github.

this is the link

Is this code having any issue ??

  • register_asset must not include the assets directory, just do register_asset "stylesheets/..."

  • the css file name starts with a space so it is not found

  • no need to register js files


this is the issue