How to add Disqus comment count

I have the same problem with displaying number of comments in the loop. I solve this by turn off two filters in file plugins/disqus/disqus.php at line 1124: <?php #add_filter(‘comments_number’, ‘dsq_comments_text’); #add_filter(‘get_comments_number’, ‘dsq_comments_number’); And I have added to my template span with disqus elements: <?php if ( function_exists( ‘dsq_identifier_for_post’ ) ) { global $post; echo ‘<span … Read more

How to move wp-content (or uploads) outside of the WordPress directory

You have to define WP_CONTENT_DIR and WP_CONTENT_URL: const WP_CONTENT_DIR = ‘/path/to/new/directory’; const WP_CONTENT_URL = ‘http://content.wp’; The new path must be accessible for read and write operation from the WordPress core directory. You might need a helper function to add the new directory path to the open_basedir list: /** * Add a new directory to the … Read more

How to update the delete user confirmation form?

On the Users (wp-admin/users.php) page, WordPress uses wp_dropdown_users() to generate the users drop-down menu you’re referring to, so I’d suggest using the wp_dropdown_users_args hook to filter the users query, e.g. to show only 1 result (or 10, but surely not 55k!) and then use JavaScript to add/load the other results. So in this answer, I’m … Read more

Customizing the Subject Field in WordPress’ Notification Emails?

You can change them using a filter. The filter hooks you want to use are: For the first email message (confirming they really want to reset the password): ‘retrieve_password_title’ ‘retrieve_password_message’ For the follow-up email message (sending the new username and password): ‘password_reset_title’ ‘password_reset_message’ Update: To create and use these filters, put the following or similar … Read more

Verify nonce in REST API?

You should pass the special wp_rest nonce as part of the request. Without it, the global $current_user object will not be available in your REST class. You can pass this from several ways, from $_GET to $_POST to headers. The action nonce is optional. If you add it, you can’t use the REST endpoint from … Read more

How to customize the default HTML for WordPress Attachments

I want to change the default HTML code structure so that I can insert additional tags Run a filter on img_caption_shortcode, you can find that hook in the source here. http://core.trac.wordpress.org/browser/tags/3.0.1/wp-includes/media.php#L720 Example add_filter( ‘img_caption_shortcode’, ‘my_caption_html’, 10, 3 ); function my_caption_html( $current_html, $attr, $content ) { extract(shortcode_atts(array( ‘id’ => ”, ‘align’ => ‘alignnone’, ‘width’ => ”, … Read more

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