How to create custom home page via plugin?

An Active Plugin To make an active plugin, use the following resources: WordPress Codex: Writing a Plugin WordPress Essentials: How To Create A WordPress Plugin by Daniel Pataki From the following StackExchange thread, try to understand what are the Hooks and what are things acting behind a plugin: How to edit a wordpress plugin without … Read more

Can I add pages to my custom menu via script?

You can use wp_nav_menu_{$menu->slug}_items hook and add you link with a callback function, for example if your menu slug is header-menu then something like this: add_filter(‘wp_nav_menu_header-menu_items’, ‘add_my_extra_links’,10,2); function add_my_extra_links($items, $args) { $newitems=”<li><a title=”Test Link” href=”http://google.com”>Google</a></li>”; $newitems .= ‘<li><a title=”Test Link” href=”http://yahoo.com”>Yahoo</a></li>’; $newitems .= ‘<li><a title=”Test Link” href=”http://bing.com”>Bing</a></li>’; $newitems .= $items; return $newitems; } Update I … Read more

Current class on admin menu using add_submenu_page()

Try this: add_menu_page(__(‘My Plugin’, ‘myplugin’),__(‘My Plugin’, ‘myplugin’), ‘edit_posts’,’my-plugin-dashboard’,’my_plugin_dashboard’,’icon’); // dashboard submenu – this fails to highlight with current add_submenu_page(‘my-plugin-dashboard’, __(‘Dashboard’,’myplugin’), __(‘Dashboard’,’myplugin’), ‘edit_posts’, ‘my-plugin-dashboard’, ‘my_plugin_dashboard’ ); // settings submenu – this fails to highlight with current add_submenu_page(‘my-plugin-dashboard’, __(‘Settings’,’myplugin’), __(‘Settings’,’myplugin’), ‘manage_options’, ‘my-plugin-settings’, ‘my_plugin_settings’ ); Essentially: don’t use full page links with admin.php?… as the page slug. Especially … Read more

Including file or library from other plugin

In your plugin add a custom action to let other plugins start after your basic code has done the work: // load basic classes do_action( ‘my_library_loaded’, plugin_dir_path( __FILE__ ) ); Other plugins can start their work now like this: add_action( ‘my_library_loaded’, ‘other_plugin_init_handler’ ); They will never do anything if your base plugin is not active. … Read more

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