• Hello, I’ve been reading almost everything about bookmarks on the codex and couldn’t find a reason for my code to be wrong. I need to have an alphabetical list of all my bookmarks with the category they’re in as “class”.
    The problem is that, even though I’m sure those links have a category, the “link_category” value is always empty (but i I can get the others values as “link_name”).

    here’s the page.
    And the code:

    <ul>
    		<?php
    		$links = get_bookmarks( 'orderby=name' );
    		foreach($links as $link) :?>
    
      			<li class="<?php echo $link->link_category; ?>">
      				<?php echo $link->link_name; ?>
    
    			</li>
    
    		<?php endforeach; ?>
    	</ul>

  • The topic ‘Get the "link_category" value from a link object’ is closed to new replies.