Support » Fixing WordPress » Placing a plugin in a theme

  • I believe I know the answer to this which is to use the do_shortcode option but I wanted to verify that this was the only way to do this.

    What I was wondering was, if I create a plugin and I wanted it to put a banner just under the top of the home page, can I do that from the plugin or do I have to add the do_shortcode option in the template itself. Example: I have a theme that has a bootstrap gallery slider at the top and I would like to put a banner underneath the gallery slider that would display upcoming events, news, or important information. Now I have this working using a child theme and then copying and modifying the header.php file from the original theme with the do_shortcode command.

    I hope I have explained this clearly enough.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The point of a shortcode is that you don’t have to edit theme files. Add the functions for your shortcode to your child theme’s functions.php fle and then place the actual sourcecode in your page in the visual editor.

    Thread Starter praiford

    (@praiford)

    Thanks kjodle but I am trying to do is create a plugin that I can use so when I move to a new theme, the banner will come with me and I don’t have to modify the functions.php file. I do have a code that works in the functions.php file that will put the banner on the header of the home page and it will work for editor’s as well as admins but it doesn’t pull the current color setting out and it has some other issues that while it functions fine could be written better. This new plug-in that I am working on fixes the issues but I can’t seem to get it so that editor’s can use it. I can get the menu to show up but as soon as they try to save it, they get the error that they don’t have permissions. I know that there should be a way to get this to work without displaying all of the admin settings because the horizontal scroll plug-in has an option to choose the capability and if editor is chosen then scroll option shows up on editor side and they can make some modifications without the rest of the admin menu showing up. I just need to know how to accomplish this.

    Also I do use child themes when working on themes so I can modify the functions.php or header.php when needed. The theme that I am trying to work with for a future release is the evolve theme from theme4press. I am working with my manager to get a paid version but for now I am working with the free version and currently updating some of the features with what we have on our current site but we are not expecting to release it until spring time. Once we get a paid version, I may be able to work with them to help implement what I am trying to do but I figured I would try here first. I want the banner to go under the bootstrap slider so I guess I have to modify the header.php to do this, which I have done that and I know it works. If there is a way to do it without modifying the header.php that would be good to know.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Placing a plugin in a theme’ is closed to new replies.