Beautify WordPress HTML output without any plugins

Great question, I asked it myself and here’s what I came up with. You can just use this in a custom plugin or in functions.php. // turn on Output Buffering (hence *ob*) ob_start(); // register a callback to run after WordPress has outputed everything add_action(‘shutdown’, function () { // get the output buffer and store … Read more

Admin Notices coding standard issue

One way you can handle this would be to do the wp_sprintf when assigning the value of the $message variable and then use wp_kses when you want to output. You could also output the div and paragraph tags before and after the message, which would eliminate the need for wp_sprintf in this instance. add_action( ‘admin_notices’, … Read more

Can I run custom php on specific pages in wordpress?

If you are using a child or custom theme, I encourage you to look at the Codex’s Template Hierarchy. The short answer to your question is yes, you can run custom code on any page you’d like. The longer answer is still yes, but it’s a bit more involved in what your end product is … Read more

Notice: Undefined property: wpdb::$current_post What can be wrong?

There are problems with this part: ++$GLOBALS[‘wpdb’]->current_post There’s no current_post property of the wpdb class, here you’re most likely confusing the wpdb class with the WP_Query class. Also we wouldn’t want in general to modify the current_post property of the global WP_Query, it could surely “bite us” if we mess with the globals 😉 Note … Read more

Pinterest Integration Using functions.php

There were several errors in your code. The biggest was that the function didn’t even have a closing bracket, but we can probably assume that was just not copied into your post, otherwise nothing would have been working for you. This is a filter on the content right? It looks like you want to append … Read more

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