Retrieving category’s color with get_term_meta

From your question, it seems that you want to fetch the meta for the post. In which case you would want get_post_meta which would look something like this: echo get_post_meta( get_the_ID(), ‘color’, true ); Change the second value (‘color’) to whatever you have used for the meta key – I took a wild guess.

List categories with posts

Finally I resolved the solution this way: $hg_categories = get_categories(); foreach($hg_categories as $hg_category) { echo ‘<h3>’ . $hg_category -> name . ‘</h3>’; $hg_posts = get_posts(array(‘numberposts’ => -1, ‘category’ => $hg_category -> cat_ID)); foreach ($hg_posts as $hg_post) { if ($hg_post -> ID == get_the_ID()) { echo ‘<li class = “current-post”><a href = “‘; } else { … Read more

wordpress sub-category ( lowercase letters + non-latin characters ) = 404

⚠️ Temporary workaround https://stackoverflow.com/a/59109698/15497563 sudo apt-get install nginx-extras nginx.conf https://stackoverflow.com/a/11170826/15497563 http { # Include the perl module perl_modules perl/lib; # Define this function perl_set $uri_uppercase ‘sub { my $r = shift; my $uri = $r->uri; $uri = uc($uri); return $uri; }’; } site-enabled https://stackoverflow.com/a/35369570/15497563 server { location ~ ^/(부모/자식a|부모/자식b|부모/자식c)(.*) { rewrite ^(.*)$ $scheme://$host$uri_uppercase; } } … Read more