"get links" customization. (7 posts)

  1. jennaction
    Posted 9 years ago #

    hey, i was wondering if anyone could help me figure this out or if it's even possible.

    i'm using the "get links" tag in my template, in the sidebar to show my links. and i want them to have commas between them, but the code isn't picking up the comma i have in the coding. it's just putting a space between the links.

    it's not that big of a deal, i guess i could just leave them as spaces, but i was just wondering if it was possible to get a comma there.

    anyone know?

    this is the tag i'm using
    <?php get_links(1, '', '', ', ', FALSE, 'name', FALSE); ?>

    i also tried this, thinking that maybe it wasn't picking up the comma... but it would pick up this other way (i don't know what those kind of things are called)
    <?php get_links(1, '', '', '‚ ', FALSE, 'name', FALSE); ?>

    neither of those are showing up as a comma though. it's just going to the default space like there's nothing in that parameter.

  2. peiqinglong
    Posted 9 years ago #

    Try using "& # 4 4 ;"(minus the spaces) in places where you want a comma to appear.

  3. jennaction
    Posted 9 years ago #

    ^ nu uh. that doesn't work either...

    i'm wondering if it's even possible. or if you can only use things like, BR LI SPAN etc.

  4. Kafkaesqui

    Posted 9 years ago #

    I found this will place commas between the links:

    <?php get_links(1, '', ', ', '', FALSE, 'name', FALSE); ?>

    However it does stick one in at the end, as well.

  5. jennaction
    Posted 9 years ago #

    i figured that out... i don't like the comma at the end though so i was trying to get it in the 'between' part.

    oh well though.
    i'll just leave it with spaces, i guess.

    thanks anyway. :)

  6. Kafkaesqui

    Posted 9 years ago #

    Well, the following is a bit overkill, but it'll remove the comma at the end of your links list:

    get_links(1, '', ', ', '', FALSE, 'name', FALSE);
    $links = ob_get_contents();
    $links = rtrim(rtrim($links), ',');
    echo $links;

  7. jennaction
    Posted 9 years ago #

    i don't care how long the code is, as long as it works...
    ... and it does!

    so thank you very much!
    that's great. :)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.