WordPress.org

Ready to get started?Download WordPress

Forums

"get links" customization. (7 posts)

  1. jennaction
    Member
    Posted 8 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
    Member
    Posted 8 years ago #

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

  3. jennaction
    Member
    Posted 8 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 8 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
    Member
    Posted 8 years ago #

    yeah.
    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 8 years ago #

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

    <?php
    ob_start();
    get_links(1, '', ', ', '', FALSE, 'name', FALSE);
    $links = ob_get_contents();
    ob_end_clean();
    $links = rtrim(rtrim($links), ',');
    echo $links;
    ?>

  7. jennaction
    Member
    Posted 8 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

Tags

No tags yet.