Auto selection of category based on subject line or TAG

I doubt there are any plugins out there that can do what you want “out-of-the-box”, however you could probably write a plugin to do what you’re looking for. Some basic boilerplate logic could look like function jcharnock_insert_post_category( $post_id, $post, $update ) { // Only run on inserts. if ( $update ) { return; } $title_categories … Read more

How to delete field using WPDB?

You can’t “delete” a field in MySQL, this only works for complete rows. However, you can unset values, meaning setting them to their original state, usually NULL or an empty string. $wpdb->update($wpdb->posts, array( ‘product_rank’ => NULL ), array( ‘ID’ => $post_id ));

adding a css file to my plugin

Don’t put the full path to the file in wp_register_style() use plugins_url() to get the full url with just the path from the plugins folder. So change: ‘localhost/wordpress/wp-content/plugins/mein-plugin/style.css’ To: plugins_url( ‘style.css’, __FILE__ )

How to display a linked category name with get_the_category

get_the_category() returns the array of WP_Term objects. So, // get all categories objects $categories = get_the_category(); // get the first category name if ( ! empty( $categories ) ) { $category = $categories[0]->name; } $output .= ‘<li><a href=”https://wordpress.stackexchange.com/questions/293636/” . get_the_permalink() . “https://wordpress.stackexchange.com/questions/293636/”>’; $output .= get_the_title() . ‘</a> ‘; $output .= $category .”https://wordpress.stackexchange.com/questions/293636/”; $output .= get_the_time(‘d … Read more