Home / bookmarks / Links with description
  • How to Links with description

    no thumbnail sorry: Links with description

    Adding this to your wordpress theme will allow you to specify a category using a custom field thecat to display a listing of links / bookmarks.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    <?php $theCat = get_post_meta($post->ID, 'thecat', true); ?>
    		<table>
    		     <thead>
    			<tr>
    				<th>Bookmark</th>
    				<th>Description</th>
    			</tr>
    		     </thead>
    			<?php
    				$bookmarks = array();
    				$bookmarks = get_bookmarks("category=$theCat");
    			if ($bookmarks[0] != '') { ?>
    			<?php foreach ( $bookmarks as $bookmark ) {?>
    			<tr <?php if($i%2 == 0){ ?> class="odd"<?php $i++; }else{ $i++; } ?>>
    				<td><a title="<?php echo $bookmark->link_description; ?>" href="<?php echo clean_url($bookmark->link_url); ?>"><?php echo $bookmark->link_name; echo $bookmarks->term_id; ?></a></td>
    				<td><?php echo $bookmark->link_description; ?></td>
    			</tr>
    			<?php }} ?>
    		</table>
    

    ( WordPress codex functions, hooks, in this snippet. )

    get_bookmarks, link_description, get_post, get_post_meta, get_bookmark, clean_url, _n,