Modify previous and next post links to current Authors Other posts

The correct method of doing this since WordPress 4.4 is simply the following: add_filter( “get_next_post_where”, function($where, $in_same_term, $excluded_terms, $taxonomy, $post){ $where .= ” AND p.post_author=””.$post->post_author.”””; return $where; }, 10, 5); add_filter( “get_previous_post_where”, function($where, $in_same_term, $excluded_terms, $taxonomy, $post){ $where .= ” AND p.post_author=””.$post->post_author.”””; return $where; }, 10, 5); Note: Please do not follow levidia1221’s accepted response, … Read more

Autocomplete or suggest from post titles inside plugin

In order to properly enqueue a script you must use the wp_enqueue_script like this : wp_enqueue_script( ‘suggest’, get_template_directory_uri() . ‘/js/path/to/suggest.js’, array(‘jquery’), ‘1.0.0’, true ); The second parameter is the path to your JavaScript file, the third parameter is the dependencies the script relies on (since suggest is a jquery plugin, it must be loaded after … Read more

Unable to set featured image

Try checking your Browsers Javascript console, Media Library in WordPress is heavily depended on javascript’s such as jQuery. also if your Javascript is broken due to concatenation, then add the below line in your wp-config.php file. define( ‘CONCATENATE_SCRIPTS’, false ); Or you can even try re-installing WordPress.

How to change “post_class()” for a custom post type?

As documented here: https://codex.wordpress.org/Function_Reference/post_class#Add_Classes_By_Filters You can add a hook to the ‘post_class’ filter to add/remove classes in the array passed. You can use the various template tags like has_post_format() and others to see what classes you need to add; you’ll have access to the ID of the post in question. You could erase the array … Read more

comment_notification_text filter for custom post type

Using comment_notification_text you will get comment notification text and comment ID. To check the post type you need to get the post associated with comment and then you can check for post type Example (Read the inline comments): function custom_notificaion($notify_message, $comment_id) { $comment_obj = get_comment($comment_id); //Get comment object $comment_post = get_post($comment_obj->comment_post_ID); //Get post object //Check … Read more

Create Custom Post Type as page

You can make a custom template for a custom post type. Generally I use the single.php file and duplicate it. Then I rename it to single-{custom-post-type}.php as per Post Type Templates. In your case the template file should look like this single-uslugi.php. As far as saving the old URLs and fixing things I don’t quite … Read more