WordPress.org

Ready to get started?Download WordPress

Forums

Cannot get true category for breadcrumbs (1 post)

  1. denutza
    Member
    Posted 1 year ago #

    When using breadcrumbs, and I have a Main Category, and 2+ SubCategories.

    When applying the following code, while i'm on' Main Category' page, it shows the breadcrumb for MainCategory >> FirstSubCategory.

    elseif (is_category()){
                           $category = get_the_category();
    			$ID = $category[0]->cat_ID;
    			echo get_category_parents($ID, TRUE, ' ยป ', FALSE );
                                        }

Topic Closed

This topic has been closed to new replies.

About this Topic