The Link List template page was a relatively easy page to create.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | <?php /* Template Name: Link List */ get_header(); ?> <div id=“primary”> <div id=“content” role=“main”> <header class=“page-header”> <div class=“post-headline”><h1>Link List</h1></div> </header> <!– link categories –> <div class=“linkcategories”> <?php $cats = get_categories( array( ‘taxonomy’ => ‘link_category’, ‘hierarchical’ => 0 ) ); foreach ( $cats as $cat ) { echo ‘<h3>’ . $cat->cat_name . ‘</h3>’; echo ‘<p>’ . $cat->description . ‘</p>’; echo ‘<ul>’; $books = get_bookmarks( array( ‘category’ => $cat->cat_ID ) ); foreach ( $books as $book ) { echo ‘<li><a href=“ ‘ . $book->link_url . ’ ”>’ . $book->link_name . ‘</a>’; echo ‘<br/>’ . $book->link_description; echo ‘</li>’; } // end books loop echo ‘</ul>’; } // end cats loop; ?> </div><!– end of link categories –> </div><!– #content –> </div><!– #primary –> <?php get_sidebar(); get_footer(); ?> |
The display consists of a double loop, one outside to loop across the link categories and the one inside to loop across the links assigned to the specific category. Note that this makes use of the category and link description as part of the display.
The short URL of the present article is: http://www.terryobrien.me/s1JM5
Personal Links
My Amazon Wishlist
My DeviantArt Gallery
My Facebook Page
My Goodreads Bookshelf
My Smashwords Catalog
My Twitter Feed
My WordPress Profile