Preview Button Custom

The only way I found to make it work is to implement the 2nd patch suggested in this trac ticket I know it’s a patch in the core files, but in the next version of WP (3.6), the change is supposed to be comited, so there shouldn’t be any problems with updates. Edit Note/Disclaimer: The … Read more

How can I make the “Preview Post” button save and preview in the same window?

Here’s a way to do it without modifying the core: add_action(‘admin_footer’,’preview_same_window’); function preview_same_window(){ ?> <script type=”text/javascript”> jQuery(function($){ jQuery(‘.preview.button’).unbind().removeAttr(‘target’); setTimeout(function(){ jQuery(‘.preview.button’).unbind().removeAttr(‘target’); },250); }); </script> <?php }

Disable single pages and archives and keep preview

You can redirect, when someone tries to see the archive or the single of your custom post type, just redirect them to another page, just put this in your functions.php add_action( ‘template_redirect’, ‘theme_redirects’, 99 ); function theme_redirects() { if ( is_post_type_archive( ‘post_type_slug’ ) || is_singular( ‘post_type_slug’ ) ) { wp_redirect( ‘my_url’ ); die(); } } … Read more

How to make scheduled post preview visible to anyone?

Draft previews Take a quick look at this chunk of core code in query.php which [Checks] post status to determine if post should be displayed. http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php#L2658 if ( ! is_user_logged_in() ) { // User must be logged in to view unpublished posts. $this->posts = array(); } …is what makes it somewhat non-straightforward to bypass for … Read more

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