WordPress.org

Ready to get started?Download WordPress

Forums

Where are random and limited links in 2.1? (15 posts)

  1. harco
    Member
    Posted 7 years ago #

    In WordPress 2.0 I made use of the functionality in 'Link Categories' to randomize the order of my links and limit the number of my links in a category. I did this to get a short list of random links in my sidebar... I thought this was a really cool function!

    But now I can't find this functionality anywhere in WordPress 2.1, because the post and link categories have been merged for some reason. It now just shows all links. It seems a shame it's gone, is there a way to get this functionality back or (god forbid) work around it with a plugin of some kind?

    Kind regards.

  2. Ephemeriis
    Member
    Posted 7 years ago #

    I'm in the same boat... Had a category called "Random Links" and was displaying a random selection of 10 links on my blog. Now I've had to turn off the display of links altogether because the list is 30+ links long.

    Haven't found a workaround or plug-in yet either...

  3. muskie
    Member
    Posted 7 years ago #

    This seems to bother more than one person. I didn't notice it at first, because my sidebar though long, is still shorter than my most recent 8 posts. I tend to ramble.

    However I don't like sidebars that are exsessively long with so many links that they are all devalued. Besides my navigation and a few fun things I want the links in my sidebar to matter. I used to use categories and display random to highlight certain things, now I'll have to stop doing that or wait for this feature to reappear.

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

    Change your templates to use the new bookmarks functions. Specifically, wp_list_bookmarks().

    See here:
    http://codex.wordpress.org/Template_Tags/wp_list_bookmarks

  5. muskie
    Member
    Posted 7 years ago #

    No, I don't think that will work. Previously I had three categories: Blogroll, Forgotten Gems, Links

    Blogroll was links to blogs funny enough
    Links was links to other stuff
    Forgotten Gems were links to old posts that I personally thought were some of my best. I had WordPress display 5 random ones in this category.

    I had WordPress display all my blogroll and other links all the time. I try to be selective in what I link to. (Sometimes :-P)

    I never tried your change but I read your link, it seems to display all links neigh categories.

    All bookmarks included, regardless of Category ID, Category Name, or Category ID
    Sorts the list by name

    I scorlled way down, if I set the limit does that limit all the categories or just the one I want? Furthermore does it randomly choose 5 like I used to do, or just display the first five every time? It appears looking at the PHP that if I passed in 5 I would end up with 5 in each category. Previously I only limited/randomized the one category. That is why I created it.

    I like the old functionality better, and I like the old simple call in my template better than having to pass in paramaters to try and fake the old functionality. Not everyone is comfortable editing PHP or maintaining there own template. This functionality was easy to add through the old menu system.

    Thanks for trying though...

  6. muskie
    Member
    Posted 7 years ago #

    No, I don't think that will work. Previously I had three categories: Blogroll, Forgotten Gems, Links

    Blogroll was links to blogs funny enough
    Links was links to other stuff
    Forgotten Gems were links to old posts that I personally thought were some of my best. I had WordPress display 5 random ones in this category.

    I had WordPress display all my blogroll and other links all the time. I try to be selective in what I link to. (Sometimes :-P)

    I never tried your change but I read your link, it seems to display all links neigh categories.

    All bookmarks included, regardless of Category ID, Category Name, or Category ID
    Sorts the list by name

    I scorlled way down, if I set the limit does that limit all the categories or just the one I want? Furthermore does it randomly choose 5 like I used to do, or just display the first five every time? It appears looking at the PHP that if I passed in 5 I would end up with 5 in each category. Previously I only limited/randomized the one category. That is why I created it.

    I like the old functionality better, and I like the old simple call in my template better than having to pass in paramaters to try and fake the old functionality. Not everyone is comfortable editing PHP or maintaining there own template. This functionality was easy to add through the old menu system.

    Thanks for trying though...

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

    Yes, in fact, it will work. Read that page again. It will do exactly what you want. The new bookmarks functionality is actually a lot better than the old links functionality. Nobody used Links properly. Half the themes out there had custom code for displaying links. get_links() straight up ignored the Link Categories settings. It was inconsistent, difficult to use, and rarely worked without large custom hacks.

    The Bookmarks functionality is at least consistent. Okay, so you don't like editing templates. Download a widget to use instead. Or use a plugin. The parameters for how it displays should be left in the template/theme, where all the rest of that is. Having it in the Links Category pages made no sense, and the need for all those custom jobs reflected that.

    So, I'm sorry if you don't like the new functionality or are uncomfortable with PHP. I suggest that you roll back to the old version of the code and continue to use it instead. The new Bookmarks is not going away, however, because it's more consistent and rational.

  8. muskie
    Member
    Posted 7 years ago #

    It seems more people think it was an unexpected and a confusing change rather than being "more consistent and rational".

    I tried to make it work by editing my template. It is true I don't like PHP, I've tried it, I read books about it, I use it but I don't like it. I think for many applications there are better choices, however it is popular and WordPress is free. I don't like VBA either but I'm forced to use it. I also don't like Perl. I think things like being object oriented was tacked to both VBA and PHP, and the grammar is inconsistent and I think more seperation of application code and presentation code should be forced or at least strongly encouraged.

    Any idea why my third link category "Links" when using this snipped of code:
    <?php wp_list_bookmarks('category=56&before=<li>&after=</li>&show_images=0&show_description=0&orderby=name'); ?>

    Ends up with the following HTML:
    <li id="linkcat-" class="linkcat"><h2></h2>

    My other two link categories work as expected and I've looked for typos, it is true I ordered by last update and random with the other two and limited one to five links, but other than that it is the same code snippet cut and pasted with 56 instead of 55 or 57.

    Why can't I use category-name instead of category, the documentation implied this was possible but either my syntax is wrong... When I use category-name it displays all the links regardless of category I seem to recall.

  9. muskie
    Member
    Posted 7 years ago #

    I seem to have used the wrong character again...

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

    a) It's "category_name" not "category-name". The underscore is correct. The dash is not. However, it also won't work in all circumstances. I'd stick to the number.

    b) I'm not sure how you could get that result. If the category did not exist, it shouldn't make it that far. Double check that the category actually has some links in it and that the number is correct and so forth.

  11. muskie
    Member
    Posted 7 years ago #

    Of course the category actually has some links in it. I mean come on...

    I posted the PHP and outputted HTML, but you don't even need to view source, you can just look at my blog. In the sidebar scroll down past Blogroll and Forgotten Gems you will come across a really skinny line, which is where the title is suppose to be followed by some links.

    This is really weird and I thought it had something to do with the category being called "Links" I changed it to "Links2" but that didn't help. I just left it busted and went to a conference.

    Muskie

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

    muskie: I didn't know where your blog was, so I really could not have looked at it until you told me. Also, you didn't post enough information to tell me anything. A scrap of HTML and PHP that makes no sense without context. I can give a best guess, but without actually being there and seeing it and so forth, that's all I can do. I am not a mind reader.

    Near as I can tell, it can't do that under normal conditions. You must have something funky in the database or something. Try deleting and recreating that category and see if that makes any difference.

  13. mrdibs
    Member
    Posted 7 years ago #

    I don't understand any of this. There was a function. Now it's gone. When asked where it went, we are directed to a page of mumbo jumbo and code. I don't have time for code. That's why I'm using a shell in the first place. What's a bookmarklet?

    JUST PUT THE DROPDOWN BOX BACK IN THE LINK CATAGORY PAGE!

    This is what happens when people try to fix what ain't broke.

  14. Bassetts
    Member
    Posted 7 years ago #

    I think the new way to do this is great. It really is not hard to just read through the page and see what is needed to add the links to the sidebar. The fact I use K2 makes it easier as I can just use the sidebar modules to enter the php needed.

  15. glowlite
    Member
    Posted 7 years ago #

    mehhh.......

    I don't agree Otto, I think it's one step backwards. There is no user advantage that I can see. I normally need to hardcode and tweak the link/cat php calls anyway, if for no other reason to get them in the correct display order. But honestly, this bookmark feature should all be done from the admin panel. Functionality and versatility is always the coders goal. Programmers/coders/developers tend to forget about end-users. To Joe Blow, who only wants a blog for the local Little League team can't use this wonderful versatile bookmark feature, what good is it? Not everybody is a PHP geek, nor wants to be. If end users can't easily use what the coders churn out it diminishes the value of it immensely. In my eyes the job is unfinished, it doesn't have a user interface in the Admin panel, it was not ready to be put in production. I'm sure there will be plugins written just so bloggers can blog. How embarrassing that would be to me if it required a plugin to use a key feature I developed. I agree it's "more consistent and rational" and adds a huge amount of versatility. IF someone wants to learn it's nuances inside and out and start hacking around. All these "bells and whistles" don't mean much if ordinary people can't use them. The old system was usable from the Admin panel, bookmarks is not.

Topic Closed

This topic has been closed to new replies.

About this Topic