display categories details by divs
-
how can I display a category by divs dynamically? The one’s I’m using right now is manually put the id for each of the categories. Is there a way I can query the category.
Also I’m having trouble generating a dynamic link for the each section. The code i used is simply for 1 link only I don’t know how to loop the code so it can generate unique link for every category.
Code I’m using right now is this.
<?php // Get the ID of a given category $category_id1 = get_cat_ID( 'category name 1' ); // Get the URL of this category $category_link = get_category_link( $category_id ); ?> <a href="<?php echo esc_url( $category_link ); ?>" title="category name 1"> <?php echo get_cat_name(6);?> <?php echo category_description(6); ?> </a> <a href="<?php echo esc_url( $category_link ); ?>" title="category name 1"> <?php echo get_cat_name(10);?> <?php echo category_description(10); ?> </a>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘display categories details by divs’ is closed to new replies.