How can I use get header from within my plugin?

I’ve created a rewrite do redirect like: /mylisting/909 ->/wp-content/themes/myplugin/edit.php?id=909 Which seems to make sense as I’m keeping the very specific logic to an individual plugin. There is a better way: Create an endpoint, use your code in a callback handler for the new URL. You get the whole theme environment for free here: get_header(), sidebars, … Read more

register_activation_hook in oop approach

It doesn’t really matter. If you simply must have it inside a class, I would use a constant and a static method. // in the main plugin file define( ‘MYPLUGIN_FILE’, __FILE__ ); // include another file with this class in class MyPlugin { public static function init() { register_activation_hook( MYPLUGIN_FILE, array( ‘MyPlugin’, ‘install’ )); } … Read more

Jquery plugin not working on single pages

Your Theme is enqueueing jQuery 1.7.2: <script type=”text/javascript” src=”http://dayfun.ir/wp-content/themes/Sparks/lib/js/jquery.min.1.7.2.js”></script> And WordPress is enqueueing jQuery 1.8.3: <script type=”text/javascript” src=”http://dayfun.ir/wp-includes/js/jquery/jquery.js?ver=1.8.3″></script> See also, Frank’s answer regarding jQuery no-conflict mode. Edit WordPress bundles a version of jQuery. You will inevitably encounter problems if your Theme (or a Plugin) enqueues a separate version of jQuery – whether by enqueueing that … Read more