Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How can I output WordPress bookmarks in my theme in tabular format, i.e. not list items?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #33275

    Ideally I want my client to use the built-in WordPress links manager to add links.

    However, I’m looking for more control over the output in my theme. The wp_list_bookmarks function has many options but still outputs as a list.

    How can I get those variables out separately and put them in a table, for example? I think I need to do something with a PHP foreach statement, but I’m still learning that stuff.

    Basically, I’m looking for something like this:




    Link Title here
    Link description here


    Thanks in advance to anyone helping out with this!

    #82445
    TheDoc
    Member

    I suppose a foreach would work, but why do you need to put it in a table?

    Can’t you just take the list and style it accordingly?

    #82458

    I’m not quite able to write the code for this myself, so what would be great is a code snippet that I could tweak/cut/paste.

    As for the second question, I’ve already thought this through and I want to display this information in tabular format, so I want to go with a table.

    I know what you mean though, and if I can’t figure out how to do it right, I’ll probably resort to making the list look like a table. But that’s kind of a bad approach. I figure as long as there’s an HTML element for a table, I should use it for making tables.

    #82459
    TheDoc
    Member

    Oh yes, by all means if it’s tabular data you should be using a table. It’s just a “list of bookmarks” sort of sounds like a “list” to me ;)

    This should work for you: http://codex.wordpress.org/Function_Reference/get_bookmarks

    #82489

    Ah, that’s pretty cool. I got it to work like I wanted.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Back End’ is closed to new topics and replies.