WP_NAV_MENU filter targets all menus

You could try the following code snippet to override the primary menu: /** * Override the primary menu. * * @param string $nav_menu The HTML content for the navigation menu. * @param array $args Array of wp_nav_menu() arguments. * @return string $nav_menu */ function wpse_150003( $nav_menu, $args ) { //Override the primary menu: if( ‘primary’ … Read more

Ajax +wordpress onClick link redirect to new page and create html content

I see two things. You’re missing an action call – you need add_action( ‘wp_ajax_render_admin_charts_page’, ‘render_admin_charts_page’ ); add_action(‘wp_ajax_nopriv_render_admin_charts_page’, ‘render_admin_charts_page’); Plus, from looking at your render_admin_charts_page() you need to change your json dataType to html. Your charts function is outputting html so all you need to do is output it; your alert() should contain all the html … Read more

Removed jQuery script from header.php , any problems?

Here is the correct way to include jQuery in your theme. Open functions.php in your theme folder and add this to it: // Proper way to enqueue scripts and styles function royal_insert_jquery(){ wp_enqueue_script(‘jquery’, false, array(), false, false); } add_filter(‘wp_enqueue_scripts’,’royal_insert_jquery’,1); This will load the WordPress bundled version of jQuery and will make sure that it is … Read more

Adding an external stylesheet to a plugin

I’m assuming your plugin is working, you just don’t get the stylesheet stuff to work? In that case, you can use the wp_enqueue_scripts action. http://codex.wordpress.org/Function_Reference/wp_enqueue_style#Using_a_Hook For usage with a stylesheet in the pluginfolder, you can use it like this: function my_plugin_name_scripts() { wp_enqueue_style( ‘my-plugin-custom-styles’, plugins_url(‘custom-styles.css’ , __FILE__ ) ); } add_action( ‘wp_enqueue_scripts’, ‘my_plugin_name_scripts’ ); Happy … Read more

Convert Custom Table Data Based Plugin To Be Searchable

There is the post type attachment, which is normally used to store information about files uploaded to WordPress’ Media Library. Additional data can be saved into custom fields/postmeta. You definitely should look into that, if you decide to go with native WP tables. Another possibility would be to make those custom tables searchable, on the … Read more