4 replies
Hi there,

There are some great plugins out there but some of them display stuff automatically I and would like to find a way that I could move them to where I wanted.

For example, there are several facebook/twitter plugins that leave a facebook boxes at the end of the post so that you can tweet them/share them on facebook. I would like to take this dislay (and others like it) and integrate them into a stylesheet (CSS) but I don't know the code that needs to used.

When you activate a plugin and it has an on site display, does the PHP that displays the plugin go into the theme editor. So could I remove it from the theme editor and put it into another template?

Any help would be much appreciated.

Many thanks

Pete
#display #php #plugin
  • Profile picture of the author XoC
    Hi Pete,

    Are you talking about wordpress?
    If so when you activate the plugin there isn't any code inserted into themes as you suggested instead it's run when the theme triggers certain wordpress functions such as get_header(), etc.

    You could move the 'plugins' into different parts of the website if the theme supports widgets.

    Hope that answers your question! if not let know
    {{ DiscussionBoard.errors[3967352].message }}
    • Profile picture of the author Peterdeg
      Hi there,

      Thanks for your answer.

      I am talking about wordpress, yes.

      The sort of plugins that I was hoping to change/move, were the addon plugins. Things like Sociable3 or something like that. This sort of plugin wouldn't be installed in the theme because they would have to have that code for every plugin out there.

      So my reasoning at the moment (might be way off the mark here) is that when you add a plugin it has all the functions in the plugin files that lets it do its job. However, there must be some interaction with the theme so that it can be displayed. It is the point where it interacts with the theme for display that I want to cut and paste somewhere else so that it shows up somewhere else.

      I hope this makes sense as it is at the limited of terminology and my understanding of PHP isn't that great.

      Many thanks

      Pete
      Signature
      {{ DiscussionBoard.errors[3967570].message }}
  • Profile picture of the author SteveJohnson
    Pete,

    You can only cut-and-paste plugin output if the plugin has been designed to work that way. Most aren't, because most people don't have the technical skills to do it. It's much easier for us as plugin developers to control where the output is placed by using WordPress's filter system. WP filters are simply a mechanism to intercept content generated by WP and add our own stuff to it. This is the way most social plugins nowadays work, including Sociable.

    However - if the developer has some foresight, they also provide you with a way to control where the output is. Sociable (I think) does this by giving you the code for your theme file(s) on their configuration page.

    If that kind of option isn't provided by the plugin author, you'll have to rewrite the plugin yourself or hire it out if you can't figure out how.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3967896].message }}

Trending Topics