WordPress title as keywords (tags) with excluded stop words

Here is your updated function solving your 2 problems : // Post title as keywords, excluded stop words function title_as_keywords( $word ) { $blacklist = array(‘this’, ‘about’, ‘that’, ‘them’); // Excluded words … $whitelist = array(‘one’, ‘man’, ‘boy’/*etc..*/); // Whitelisted words … if ( (!in_array( $word, $blacklist ) && strlen( $word ) > 3 ) … Read more

Auto update post title and slug when post status is changed

I think I found the solution: add_filter(‘wp_insert_post_data’,’reset_post_date’,99,2); function reset_post_date($data,$postarr) { //update post time on status change $data[‘post_date’] = $data[‘post_modified’]; $data[‘post_date_gmt’] = $data[‘post_modified_gmt’]; //also update title and add the current date to title $data[‘post_title’] = ‘Your Default Title – ‘. current_time ( ‘m-d-Y’ ); //also update the slug of the post for the URL $data[‘post_name’] = … Read more

How to get the title of the random images from media library?

Your first function get_images_from_media_library() only returns images guid, I’d suggest to extend it by returning all image datas : function get_images_from_media_library() { $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ =>’image’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => 6, ‘orderby’ => ‘rand’ ); $query_images = new WP_Query( $args ); $images = array(); foreach ( $query_images->posts as $image) { … Read more

Wp Admin Bar Customizing Labels

Don’t use add_filter with the_content that way; that is meant for a different context – when you are filtering a returned WP post object. Try something like this instead: function replace_customer_area_title( $wp_admin_bar ) { $newtitle = __(‘Custom Title’, ‘cuar’); $wp_admin_bar->add_node( array( ‘id’ => ‘customer-area’, ‘title’ => $newtitle, ) ); } add_filter( ‘admin_bar_menu’, ‘replace_customer_area_title’ , 33 … Read more

Ampersand breaking Widget title

SOLUTION: So, it turned out (of course) I myself was causing the problem (…) I am getting the widgets with the ‘the_widget()’ method and sending the instance params along as I go. The params are query-string-style parameters and are of course ‘glued’ together with ampersands. Now , I wasn’t encoding the individual params so the … Read more

How to remove “» (title of post or page)”?

Search your code for » and narrow down where it’s referenced. Chances are not many places. Look in all your theme and plugin folders. Even do a grep on the /wp-content folder. grep -winr ./wp-content -e ‘»’ It looks like bad php code — maybe copy/paste where the quotes didn’t match up.

How to disable publish button if post title exists

This is something you could always do with the help of jQuery Ajax, and get_page_by_title(‘About’, OBJECT, ‘post’) tool. You basically listen to changes on the title field, check if at least 1 post already exists with same title, then enable the submit button if it doesn’t, otherwise keep it disabled as it is by default … Read more