get_next_post() not working

Only a guess but you might need global $post before your code. According to the Codex docs for the functions you are using the return values are Null if global $post is not set. Also you might want to use their suggested logicals: if (!empty( $prev_post ))

Creating a Post, can authors be ordered by last name?

Here’s one example how we can modify the order of users in the dropdowns on the post.php and post-new.php pages (PHP 5.4+): /** * wp_dropdown_users – modify ordering on post.php and post-new.php */ add_filter( ‘wp_dropdown_users_args’, function( Array $query_args, Array $args ) { // Nothing to do if we’re not on post.php and post-new.php if( ! … Read more

Insert posts in two tables

No. You’d have to change core WordPress functionality to achieve that (lots of work, and you’ll have to do it again for each upgrade). And if you’re finished with that, you’ll probably have to change some plugins as well. Generally, a big wp_posts table isn’t a problem. If your site is slow, look into where … Read more

Fatal error post.php help :(

Put your code in whatever function: function whatever(){ // do stuff } add_action( ‘init’, ‘whatever’ ); Or use this to check whether user is logged in or not: if( get_current_user_id() ) { // logged in user }

Can’t publish new posts

There are, still, references to old domain in your database, which have to be fixed. Step 1: go to Settings -> Permalinks and click on Save Changes button. This will fix your permalinks. Step 2: install and activate Better Search Replace plugin. Go to Tools -> Better Search Replace. Replace the old domain ( example.com … Read more

If specific user role then sticky post

It looks like it is possible. Sticky posts are stored as array of IDs in an option called ‘sticky_posts`, and you can modify options using hooks, so… There is a chance that something like this would work: function fake_sticky_posts_for_author() { $user = wp_get_current_user(); if ( get_current_user_id() && in_array(‘author’, $user->roles) ) { // Return the IDs … Read more