Custom taxonomy link opens under Posts

I had the same problem even though my taxonomy was registered to Users. Found the answer at Custom user taxonomies in WordPress by Justin Tadlock (see the comments for the post). Add this to your code (replace YOUR_TAXONOMY with the proper name): function fix_user_tax_page( $parent_file=”” ) { global $pagenow; if ( ! empty( $_GET[ ‘taxonomy’ … Read more

Creating Admin Plugin – Content of a page is displayed at global scope as well

Question #1 – The above code will output 23123 twice, when visiting plugin page and when not. How do I make it print the content of my page only when page is the current screen? Basically: http://localhost/wp-admin/admin.php?page=camden-vmtool When you initialize the class, you are hooking the pageInit() method into a hook that fires on all … Read more

WordPress admin menu formatting issue

Otto has suggested a fix in Chrome itself until the bug is resolved: Go to chrome://flags/#disable-slimming-paint Enable the “Disable slimming paint” option. Ensure that the “Enable slimming paint” option below it is not turned on. Relaunch Chrome. If you don’t want to take this approach you can fix this with CSS: function chromefix_inline_css() { wp_add_inline_style( … Read more

Pagination in plugin’s backend

In the admin back-end of a plugin, you can’t use the query_vars hook and the get_query_var built in function since the page itself is a query parameter. To get around this, I simply add a new query parameter to the end of your plugin page link called, ‘&pagenum=#” and I pull it out manually using: … Read more

Declaring in variables [closed]

You need to call global $variable; before you can use the variable. Try the code below instead for that line. // setup your global scope here global $icon_var; // set the new value in global scope $icon_var = get_post_meta($menu_item->ID, ‘_menu_item_custom’, true); // then use the variable $menu_list .= “\t\t\t\t\t<li><a href=\”$url\”>$icon_var<span>$title</span></a></li>\n”; DYNAMIC GLOBAL VARIABLE NAME If … Read more

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