Header menu

_________________________________________________________________________________
Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Thursday, 3 October 2013

Media upload error in wordpress after installation of customized plugin

Media upload error in wordpress after installation of customized plugin
 
After installation of custom plugin in wordpress sometimes error occurs while media upload.

The reason is you have may be you have included '$' in js of plugin(replace $ with jQuery)  or might be you have added js in plugin_name.php file. 

      



Media upload error in wordpress after installation of customized plugin



To correct the error include your js of plugin in separate js file and put this file in plugin_name folder with plugin_name.php file.

And to use this js in plugin add the below function in plugin file.

function my_scripts_method() {
    wp_enqueue_script(
        'plugin_name',
        plugins_url() . '/plugin_name/plugin_name.js',
        array( 'jquery' )
    );
}

add_action( 'wp_enqueue_scripts', 'my_scripts_method' );




Hope this will solve your problem :)


Tuesday, 24 September 2013

Could not create directory. /opt/lampp/htdocs/wordpress-test/wp-content/upgrade(Theme installation problem in wordpress)

Could not create directory. /opt/lampp/htdocs/wordpress-test/wp-content/upgrade

 Could not create directory. /opt/lampp/htdocs/wordpress-test/wp-content/upgrade

This error occur when you try to install some new theme on wordpress .
And your wp-content is not writable.





To correct this error

Change permissions on the /wp-content directory to 0775
 

if not work Change permissions on the /wp-content directory to 0777.

And dont forget to restore your permission after work is done as security measure.

Monday, 23 September 2013

Fatal error : Call to undefined function add_menu_page()

Fatal error : Call to undefined function add_menu_page()

If you want to add menu to admin section of wordpress through custom plugin and you got
"Fatal error : Call to undefined function add_menu_page() " error.

Then reason for error might be there is no add_action function found in plugin

Try this code to solve this error in your plugin file.

<?php

/*
Plugin Name: Myplugin

Description:
Version: 2.5.324
Author: Amit kumar


*/
add_action('admin_menu', 'test');

function test(){
    add_menu_page(__('My Menu Page'), __('My Menu'), 'edit_themes', 'my_new_menu', 'my_test_function', '', 7);
}

function my_test_function(){
    echo "hello world .. !!";
}