Show excerpt if no title in admin view

You can try the following approach using the the_title filter in the edit.php screen: /** * Modify post titles in the edit.php screen. * If the post title is empty, then show max 10 words from the post content instead. */ add_action( ‘load-edit.php’, function() { add_filter( ‘the_title’, function( $title ) { $post = get_post(); if( … Read more

Remove Permalink From Admin Edit Post

I’m running the most up to date version of WordPress which has made changes to how permalinks are displayed and handled. There’s no longer a View Post button. I was able to remove the whole area using the get_sample_permalink_html hook. Just return an empty string: function hide_permalink() { return ”; } add_filter( ‘get_sample_permalink_html’, ‘hide_permalink’ );

Featured image on post edit page not loading over HTTPS

It turned out to be a problem with the uploads directory (not sure what caused it initially). I was able to resolve the issue with the following filter: function fix_ssl( $url ) { if ( is_ssl() ) { if (stripos($url, ‘http://’) === 0) { $url=”https” . substr($url, 4); } } return $url; } function uploadDir($uploads) … Read more

Problem with Settings API: changes are not saved after submit

You need to register the proper settings fields in your PPAdminOptions() and also point the form action to options.php: function PPAdminOptions() { if ( !current_user_can( ‘manage_options’ ) ) { wp_die( __( ‘You do not have sufficient permissions to access this page.’ ) ); } ?> <div class=”wrap”> <h1><?php echo get_admin_page_title(); ?></h1> <form method=”post” action=”options.php”> <?php … Read more

How can I merge two authors?

Delete one account. Upon deletion WP will prompt you with a question of whether to delete all posts by said author or attribute them to another user. Simple as that, wanted functionality is provided by the core.

Redirect from the dashboard to edit.php if wp_is_mobile() is true

The action you’re looking for is auth_redirect, which is before the headers but still recognizes $pagenow to tell which page you’re on: add_action(‘auth_redirect’, ‘the_mobile_boot’); function the_mobile_boot() { global $pagenow; if ( $pagenow == ‘index.php’ && wp_is_mobile() ) { header( ‘Location: ‘ . get_admin_url(null, ‘edit.php’) ); exit; } }

How do I correctly transfer my site from one domain to another?

These two pages on the WordPress codex give a good overview changing URLs: http://codex.wordpress.org/Changing_The_Site_URL http://codex.wordpress.org/Moving_WordPress However to cut a long story short, what I always do is the following: Back everything up Copy this handy little file to the root of your site: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Run it It should pick up all of your settings, so … Read more

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