New to wordpress, Question about editing PHP

A plugin in WP is a concept more related to user friendly packaging of code, rather than mechanics of code itself.

I don’t want to overly confuse you, but in practice plugin can act like a theme and theme can perform functions common to plugins. Just be aware that these things are more about semantics then code.

When dealing with plugins that interact with theme output it’s important to remember that only way they can accomplish that is by using hooks. Theme is strongly expected to make a number of generic function calls (such as wp_head() and wp_footer()) that set up important hooks and use template tags that come with hooks of their own.

So the most likely reason that plugin fails with specific theme is that theme is of poor quality or very outdated and doesn’t provide hooks that plugin requires. There is no generic solutions to this – it entirely depends on specifics of concrete theme and plugins how/if they can be fixed to work together if they don’t.