• OK. My blog’s here:
    https://www.kahotep.net/prometheancommunication

    but it will require login… so let me know if you wanna look.
    In the meantime, let me explain my issue. I’ve got wp_list_bookmarks in my right sidebar. Before you go tell me to read the codex, let me point out that I’ve rea, re-read and tried many of the suggestions from the codex page on wp_list_bookmarks and everything I could find in the forum.

    My right sidebar lists links to news/media stories that I’m monitoring. I categorize them according to the date of each news story (as I’m hoping in the future to be able to list them easily, nicely categorized by date, on a page, but that’s for another time..)…

    screenshot here

    now, here’s the code I’m using in my sidebar:

    <?php wp_list_bookmarks ('limit=28&before=<li class="news_link_bold">&after=</li>&orderby=id&order=DESC&categorize=0&title_li=&title_before=<h2 style="display:none;">', '<li>', '</li>', "&title_before=<!--&title_after=-->"); ?>

    That lists the 28 most recent links in descending order of ID. And it lists them all in bold, because I’ve put that little <li class="news_link_bold"> in there (and added the relevant CSS in my stylesheet).

    Now, without affecting the order of the links, I only want one or two of the links to be in bold, and the rest to be ‘font-weight: normal’. I cannot for the life of me figure out how to do this. I’ve tried putting the links that I want bold into a category and then specifying a second argument for that category, but I just get parse errors when I try to add a second argument. Now I know that I should really go and read up on php, but I figured that maybe one or two of you may have already tried implementing a similar thing and may be able to help me out… so… if you can.. I would appreciate it.

    Many thanks in advance.

    P.S. If you want to view my site, then email me using my email in the profile (if that’s possible?), or go to my home page and use the contact form.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    It is extremely difficult to help you without seeing your specific site. Or at least the resulting HTML code that this bookmarks code produces.

    Post the final HTML that that creates, because without that, there’s no easy way to tell you how to structure your CSS.

    Thread Starter zuberi

    (@zuberi)

    Hi Otto. Thanks for the quick response.
    Here’s the resulting code in my sidebar:

    <div id="sidebarright">
    <h2>Newswatch</h2>
    
    <li class="news_link_bold"><a href="https://www.cnn.com/2008/CRIME/10/27/illinois.shootings.hudson/index.html?iref=mpstoryview" target="_blank">Body in SUV believed to be Hudson’s nephew, police say</a></li>
    <li class="news_link_bold"><a href="https://www.cnn.com/2008/POLITICS/10/27/palin.tension/index.html" target="_blank">Palin’s off-script comments irk McCain aides</a></li>
    <li class="news_link_bold"><a href="https://news.bbc.co.uk/2/hi/middle_east/7693583.stm" target="_blank">Syria hits out at US ‘terrorism’</a></li>
    <li class="news_link_bold"><a href="https://news.bbc.co.uk/2/hi/middle_east/7692500.stm" target="_blank">Syria condemns ‘US village raid’</a></li>
    <li class="news_link_bold"><a href="https://news.bbc.co.uk/2/hi/americas/7693362.stm" target="_blank">‘Body found’ in Hudson boy hunt</a></li>
    <li class="news_link_bold"><a href="https://us.cnn.com/2008/CRIME/10/27/arkansas.shootings/index.html" target="_blank">2 dead in Arkansas campus shooting; one suspect in custody</a></li>
    
    <li class="news_link_bold"><a href="https://abcnews.go.com/US/wireStory?id=6116930" target="_blank">Shooting at Ark. University Kills 2, Wounds 1</a></li>
    <li class="news_link_bold"><a href="https://www.cbsnews.com/stories/2008/10/27/national/main4546724.shtml" target="_blank">Arkansas Campus Shooting Leaves Two Dead</a></li>
    <li class="news_link_bold"><a href="https://money.cnn.com/2008/10/27/markets/world_markets/index.htm" target="_blank">Global stocks suffer brutal losses</a></li>
    <li class="news_link_bold"><a href="https://www.cbsnews.com/stories/2008/10/27/business/main4546913.shtml" target="_blank">Nikkei Index Closes At 26-Year Low</a></li>
    <li class="news_link_bold"><a href="https://news.bbc.co.uk/2/hi/business/7692559.stm" target="_blank">Global shares continue to slide</a></li>
    <li class="news_link_bold"><a href="https://www.shortnews.com/start.cfm?id=74316" target="_blank">Paul McCartney’s Head Found In Rubbish Bin</a></li>
    
    		</div>
    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Ah. Okay then.

    It can’t be done that way without modifying the core code of wp_list_bookmarks() itself. You want to make arbitrary ones of those LI elements have an additional class without changing the order. Can’t do it.

    So, write your own loop instead. Use get_bookmarks to simply get the bookmarks, and then output them yourself as the links you want.

    https://codex.www.ads-software.com/Template_Tags/get_bookmarks

    is it possible to add a class to the a tag using this function, rather than the li tag ? so the output would be something like this:

    <h2>Title</h2>
    <ul>
     <li><a href="link.html" class="myclass">Some label text</a></li>
    </ul>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp_list_bookmarks – using arguments and CSS to modify one category’ is closed to new replies.