How Do I add a redirect rule to WordPress?

adding these functions should do the trick. First things first, add this line to functions.php while you are working on this: add_action(‘init’, ‘flush_rewrite_rules’); What that code will do is constantly flush the rewrite rules, it makes this easier to test while you are working on it, instead of having to go in and manually reset … Read more

Echo simple string in Plugin

A subtle difference between your syntax wp-footershould be wp_footer, underscore _ and not hypthen – add_filter(‘wp-footer’, fahad); // wrong… add_filter(‘wp_footer’, ‘fahad’); // right.. Follow the naming convention of functions: (Codex) Plugin_API: Action_Reference » the wp_footer hook (Codex) Plugin_API: Action_Reference (Codex) Function_Reference

How can I reduce the amount of files loaded/included per plugin?

Previous versions of WordPress didn’t really provide a good means to conditionally enqueue stylesheets and JavaScript within a plugin (i.e. only when needed). So most plugin authors enqueued both on every WordPress init/load, even if the plugin wasn’t being used on a given page. Current versions of WordPress allow for enqueuing later in the flow … Read more

Right approach for plugin output styling/template

Make it as simple as possible for theme developers. Most are not programmers. There are two very simple options: add_theme_support() and get_theme_support() Provide an identifier and some options. Let’s say your identifier is drtanz_plugin. A theme author could now add the following to her theme’s functions.php: add_action( ‘after_setup_theme’, ‘prefix_register_theme_support’ ); function prefix_register_theme_support() { add_theme_support( ‘drtanz_plugin’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)