Category menu that filters out empty categories

I had an error in the above code. $key used in both for loops. Working code for filtering empty product categories out of menu items: function exclude_empty_cat_menu_items( $items, $menu, $args ) { // Get a list of product categories that excludes empty categories $non_empty_categories = get_categories(array(‘taxonomy’ => ‘product_cat’)); // Iterate over the menu items foreach … Read more

WP url to get rss with full text of post

Find an archive that displays what you want, and add /feed/ to the end e.g. /category/test becomes /category/test/feed, / becomes /feed/, /books/ becomes /books/feed If you add /feed to the end of a single posts URL you will get a comment feed You can also do /feed/rss2 or /feed/atom RSS feeds should contain a title … Read more

get categories the post was in and just been removed from

save_post runs too late to do what you are trying to do. That hook fires after the post and related meta data are stored. The category has already been removed at that point, and WordPress keeps no record. You will need to hook into the save process earlier, perhaps pre_post_update: add_action( ‘pre_post_update’, function($post_ID,$data) { var_dump($post_ID,$data); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)