how to call the category of the post

Well first off, that code’s a mess to read, some formatting would definitely help get you an answer. That said, here’s the documentation on WP_Query and some sample code to boot $args = array( ‘post_status’ => ‘publish’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘your_cat_slug’ ) ) ); $posts = … Read more

Get Child category “name” of post

menardmam, this is my solution: <?php $showPostsInCategory = new WP_Query(); $showPostsInCategory->query(‘cat=”. $carouselCategory .”&showposts=”. $carouselNumber .”‘); if ($showPostsInCategory->have_posts()) : while ($showPostsInCategory->have_posts()) : $showPostsInCategory->the_post(); ?> <li> <?php $data = get_post_meta( $post->ID, ‘key’, true ); ?> <?php foreach((get_the_category()) as $category) {echo ( $category->cat_name != $carouselCategory ) ? $category->cat_name . ‘ ‘ : ”;}?> <a href=”https://wordpress.stackexchange.com/questions/45198/<?php if ($data[“custom_link’ ]) … Read more

add an image field to wordpress category

I had some trouble saving custom taxonomy fields, which I resolved in this WPSE post. I was using the options table to save my data, but the same solutions may apply for you too. Firing callbacks attached to create_{taxonomy} and edited_{taxonomy} were part of the solution.

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