Lowest catagory link

Atlast done it fully $categories = get_the_category($post->ID); foreach($categories as $category) : $children = get_categories( array (‘parent’ => $category->term_id )); $category_link = get_category_link($children); $has_children = count($children); if ( $has_children == 0 ) { $name=$category->name; $category_link = get_category_link($category); echo “<a href=”https://wordpress.stackexchange.com/questions/161873/$category_link”>$name</a>”; } endforeach;

the_category if/else statement

Is the code used inside of the loop? The following code should work: if ( class_exists( ‘DPortfolio’ ) ) { echo DPortfolio::instance()->dportfolio_get_category(); }else{ the_category(); //or echo get_the_category(); } If outside of the loop you can try echo get_the_category( $post_id ) to show the categories. Note: As you are getting an error, if you edit the … Read more

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