WordPress.org

Ready to get started?Download WordPress

Forums

Links not getting the br inbetween the li's if you know what im saying (9 posts)

  1. 87rounds
    Member
    Posted 9 years ago #

    On my links page, the link and descriptions arent separated. For example, I expect this:

    But I get this:

  2. InfoCynic
    Member
    Posted 9 years ago #

    I have the same thing and it's even worse because I had additional custom HTML being used such as <li class=\"comic\"> so that I could format that class of links differently, and it's not showing up at all in the HTML source. It was working fine in the 1.3 version I was running; it only broke when I went to 1.5. See example here, the comics links at right.

  3. interknox
    Member
    Posted 9 years ago #

    are you using the <br /> tag after wherever you want the space to be?

  4. Lori
    Member
    Posted 9 years ago #

    My index page did the same thing once, so I just put a between "My website" right before "This is my website, blah blah blah."

    "My website"
    This is my website...

    That should work. If not, post the coding for that part of the file and I can try to figure it out.

    ~ Lori

  5. Lori
    Member
    Posted 9 years ago #

    ok the html I am trying to show you didn't post...:((

    it's the letter "p" with < > around it.

    "My website"
    < p > This is my website... < / p > (without spaces) ;)

  6. InfoCynic
    Member
    Posted 9 years ago #

    I'm trying to use the Links Manager to do this. In wp-admin/link-categories.php, specifically, I have for the comics category, under formatting (before, between, after):
    <li class=\"comic\"> <br /> </li>

    and it doesn't work. It SHOULD generate that li with the class attribute before that category starts and a br/ between the link title and link, and a /li to wrap the category up.

  7. InfoCynic
    Member
    Posted 9 years ago #

    OK, I fixed it with some work.

    Step 1: modify links.php, insert this as line 489 (in the middle of the query, just before the FROM line)
    text_before_link, text_after_link, text_after_all

    This has the effect of actually selecting the fields you need. Funny thing that.

    Now if you changed that right, go down to your new line 508 which has some nonsense about <li> and n which I thought was really cute. Trash that line or comment it out, whatever, and replace it with
    $cat['text_before_link'],$cat['text_after_all'],
    $cat['text_after_link'],

    (that can be one line, but the forum display messes up if I don't put the line break in)

    Now this clears up MOST problems. There's still the little bug that the link categories manager will NOT allow you to correctly use ' or " in any of the text fields. I had to hack that directly into SQL...

    mysql> update wp_linkcategories set text_before_link = '<li class="comic">' where cat_id = 4;

    but that's not hard, at least for me.... :)

  8. HARVEYK
    Member
    Posted 8 years ago #

    Hello, Instead of line numbers, can you post the actual code before and after where your new lines should be? I just intalled 1.5.1 and it seems the line numbers are different. Thanks!

  9. InfoCynic
    Member
    Posted 8 years ago #

    function wp_get_linksbyname($category, $args = '') {
    global $wpdb;
    $cat = $wpdb->get_row("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
    . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
    . " text_after_all, list_limit FROM $wpdb->linkcategories WHERE cat_name='$category'");
    if (! $cat) {
    return;
    }
    if (empty($args)) {
    if ($cat->sort_desc == 'Y') {
    $cat->sort_order = '_'.$cat->sort_order;
    }
    get_links($cat->cat_id, $cat->text_before_link, $cat->text_after_all,
    $cat->text_after_link, bool_from_yn($cat->show_images), $cat->sort_order,
    bool_from_yn($cat->show_description), bool_from_yn($cat->show_rating),
    $cat->list_limit, bool_from_yn($cat->show_updated));
    } else {
    $args = add_query_arg('category', $cat->cat_id, $args);
    wp_get_links($args);
    }
    } // end wp_get_linksbyname

    I don't think that's my code... I'm thinking this was fixed in 1.5 ... that's just what's in my links.php in 1.5.1.2

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.