Pagination always adding “Next” link when results come from Custom Post Type WP_query

/doctors/ is a post type archive, so we can check if that query is being run in the pre_get_posts action via the conditional tag is_post_type_archive( ‘doctors’ ) and modify those queries accordingly. WordPress passes the query object to the function by reference ( $query in this example ), so we can modify the query vars … Read more

Adding page subdirectory dynamically, as like buddypress does

This should do what you want: add_action(‘generate_rewrite_rules’, ‘wpse128082_add_rewrite_rule’); function wpse128082_add_rewrite_rule($wp_rewrite) { $new_rules = array( ‘^charts/(.*)’ => ‘index.php?pagename=charts&something=’.$wp_rewrite->preg_index(1), ); $wp_rewrite->rules = $new_rules + $wp_rewrite->rules; } add_filter(‘query_vars’, ‘wpse128082_add_query_var’); function wpse128082_add_query_var($query_vars) { $query_vars[] = ‘something’; return $query_vars; } On your Charts page, you can access the new query var with get_query_var(‘something’).

RSS Feed to contain posts from 1 category only

This should work for you if you put it in the functions.php file in your theme. Just replace where I have “CATEGORY NAME HERE” with the category name. function custom_feed_wpse_128087($qv) { if (isset($qv[‘feed’])) { $qv[‘post_type’] = get_post_types(); $qv[‘category_name’] = ‘CATEGORY NAME HERE’; } return $qv; } add_filter(‘request’, ‘custom_feed_wpse_128087’);

How to Disable UNICODE slug?

My solution using 3 combined hooks wp_insert_post_data, wp_ajax_sample-permalink,name_save_pre //==================DISABLE GEORGIAN + Russian SLUGS for POSTS================ //disable slug on any update add_filter(‘wp_insert_post_data’, ‘myappend_slug’, 3); function myappend_slug($data) { $data[‘post_name’]= slug_modify($data[‘post_name’]);return $data; } add_action( ‘wp_ajax_sample-permalink’, ‘MyajaxSamplePermalink’,1); function MyajaxSamplePermalink($data) { // check that we’re dealing with a product, and editing the slug $post_id = isset($_POST[‘post_id’]) ? intval($_POST[‘post_id’]) : 0; … Read more

Email notification

$ticket is a WP_Post object. It should have all of the information you need. Just add that information to the $message string to create whatever content you want. Bare-bones example: $message=”You are viewing “.$ticket->post_title; $message .= ‘Post Content: ‘.$ticket->post_content; $message .= ‘View it: ‘ . get_permalink( $ticket->ID ) . “\nEdit it: ” . get_edit_post_link( $ticket->ID … Read more