/ Published in: PHP
How to display your page or categories list within a definition list instead of the default unordered list. The first block is about pages and the second one is about categories.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<dl> <dt><a href="<?php bloginfo('url') ?>">Lorem Ipsum</a></dt> <?php $pages = get_pages(''); foreach ($pages as $pagg) { $option = '<dd><a href="'.get_page_link($pagg->ID).'">'; $option .= $pagg->post_title; $option .= '</a></dd>'; echo $option; } ?> </dl> <dl> <dt>Lorem Ipsum</dt> <?php $categories=get_categories(''); foreach($categories as $category) { echo '<dd><a href="'.get_category_link( $category->term_id ).'">'.$category->name.'</a></dd>'; } ?> </dl>