List of all posts from current category on single portfolio page

Update your following part of code: $term = get_queried_object(); $category_name = $term->slug; //category slug $args = array( ‘post_type’ => ‘portfolio_page’, ‘post_status’ => ‘publish’, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘category_name’ => $category_name );

Showing related post for custom taxonomy

Try this $tags = wp_get_post_tags($post->ID); $tag_ids = []; foreach($tags as $individual_tag){ $tag_ids[] = $individual_tag->term_id; } $args=array( ‘tag__in’ => $tag_ids, ‘post__not_in’ => array($post->ID), ‘posts_per_page’=> 4, ); $my_query = new WP_Query( $args ); //Check echo ‘<pre>’; print_r($my_query); echo ‘</pre>’;

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