Error showing in current page id in wordpress admin

While front–end of the site always has a post context (you are either looking at one or archive of posts), admin side doesn’t. So plenty of admin screens won’t have $post global set to anything. You should be checking if it’s meaningful (for example by if ( ! empty( $post ) )) before trying to … Read more

How to change home page only in WordPress

You should use custom template for this purpose. Create a new file homepage.php and write the below code. <?php /* Template Name: Homepage */ ?> <?php <!–Your code goes here–> ?> Then, create a new page in admin panel like HOME and in right sidebar select your “homepage” template you just created. Do not forget … Read more

Get access to WordPress when logged out

So the plugin mishaps are blocking you from signing into the dash? You will likely need server access or someone who has this access if you’re not using version control. You can just rename the folder for the plugin that you want to de-activate (BBPress Like Button). That will force it to de-activate since the … Read more

Multiple wp_editor instances in custom post type using Ajax

forget about using wp_editor on such scenario.. instead use the core tinymce, something like; tinymce.init({ //selector: ‘customEditor-‘ + nextPlusSignId, editor_selector: ‘nwac_editor_’ + nextPlusSignId, mode: “specific_textareas”, media_buttons: false, menubar: false, content_css: nw.baseurl + ‘/skins/wordpress/wp-content.css’, body_class: ‘mce-content-body nwac_plus_signs_’ + nextPlusSignId + ‘_template post-type-products post-status-publish mceContentBody webkit wp-editor wp-autoresize html4-captions has-focus’, });

Hide user group filtering links

In WP terminology these are called Views. They are pretty generic, implemented on WP_List_Table level and passed through dynamic views_{$this->screen->id} filter. Killing them completely for your requirements is as simple as: add_filter( ‘views_users’, ‘__return_empty_array’ ); Of course you might want to do something more thorough, like modifying them more precisely and leaving some necessary views … Read more

Use AJAX in a WordPress Plugin to Get Data From Custom Database?

You can use like this for send ajax… function my_action_javascript() { ?> <script type=”text/javascript”> jQuery(document).ready(function ($) { var data = { ‘action’: ‘my_action’, ‘whatever’: ‘1’ }; $.post(ajaxurl, data, function (response) { if ($(‘#menu_order’).val() == ” || $(‘#menu_order’).val() == ‘0’) $(‘#menu_order’).val(response); }); }); </script> <?php } add_action(‘admin_footer’, ‘my_action_javascript’); function my_action_callback() { $whatever = intval($_POST[‘whatever’]); //$whatever += … Read more

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