• I’m having a problem with the get_category_link function. It only seems to return the current URL instead of the category URL. I think I’ve using it correctly, please see below for how I’m using the code.

    $args=array(
      'orderby' => 'name',
      'taxonomy' => 'custom-cat',
      'order' => 'ASC',
      'pad_counts' => true
      );
    
    $categories=get_categories($args);
    
    foreach($categories as $category) { 
    
    	$categorylink = (int) $categorylink;
    	echo $category->description . '<p><a href="' . get_category_link( $category->term_id ) . '" . ' . '>' . $category->name.'</a> </p> ';
    	echo  ( $category->term_id );
    
    }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘get_category_link function returns current URL’ is closed to new replies.