WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Link Limit Being Ignored (7 posts)

  1. Lasalas
    Member
    Posted 7 years ago #

    The "Limit" field in link categories appears to be ignored. Anyone else getting this? I'm using 2.0.2

  2. Lasalas
    Member
    Posted 7 years ago #

    I just had a look at the code, and the template itself appears to be telling the get_links() function how many to show, among other things. Should it be overriding the preference I set in the actual category?

  3. moshu
    Member
    Posted 7 years ago #

    Always check the description, usage, parameters of the tags used in the template:
    http://codex.wordpress.org/Template_Tags#Links_Manager_tags

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    get_links() does not respect the link limit settings in any shape or form. You really want to use wp_get_links() instead. If you pass it a category number like the codex says, then the link limit you set for that category will be respected properly, as will all the before and after stuff for the links.

  5. Lasalas
    Member
    Posted 7 years ago #

    Thanks guys, that helped a lot. Now I just have to fix this terrible template I can't believe I paid money for...

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    The links thing is tricky. A lot of theme authors prefer to use get_links because it gives the theme control over all those settings, and lets the theme author make the links list fit the theme better. Whereas users then wonder why none of the options in the links stuff seem to do anything. It's a problem, certainly.

    It doesn't help matters that all the functions involving links have some very odd and inconsistent behavior as well.

    What really needs to happen is that the wp_links* functions need to use the settings from the options unless the theme overrides them. Then theme authors could override the settings like before and after and between and such, but respect the stuff like limits and so forth. Clearly work needs to be done here.

  7. Lasalas
    Member
    Posted 7 years ago #

    I agree. It was confusing at first, but being in the web development business means I can usually figure it out. It would have been a lot more frustrating for someone who "just wants it to work".

    Otherwise, theme integration seems to be really good - Now I just need to convert mine to liquid :)

Topic Closed

This topic has been closed to new replies.

About this Topic