Forum Replies Created

Viewing 1 replies (of 1 total)
  • I solved the problem.
    Open collapscatlist.php and move to line 61.

    Old

    $link = "<a href='" . get_term_link($the_cat, $cat->taxonomy) . "' ";

    Change it to:

    $link = "<a href='" . get_term_link(intval($the_cat), $cat->taxonomy) . "' ";

    That is it!

    ========
    P.S.
    I have been very frustrated by people who find solutions to their problems and don’t bother at all to inform others of their solutions. If this problem bothered you for long, please try to post this solution to at least one more place where users can find answers.

    ===========
    There is something too that i found about catchable errors: They are catchable. Therefore a far more robust solution to the problem above is to replace the old code in line 61, i.e:

    Old

    $link = "<a href='" . get_term_link($the_cat, $cat->taxonomy) . "' ";

    with this:

    /*
    Incase of an insolvable link error, use the get_category_link() function which does NOT raise an error upon failure
    */
    if (is_wp_error(get_term_link(intval($the_cat), $cat->taxonomy)))
    	{
    		$link = "<a href='" . get_category_link($the_cat) . "' ";
    	}
    	else
    	{
    		$link = "<a href='" . get_term_link(intval($the_cat), $cat->taxonomy) . "' ";
    	}

Viewing 1 replies (of 1 total)