2.1 – Restrict # of links shown in each category?
-
I have a ton of links and I like to show a random 5 for each category, but I can’t seem to figure out how to set the number of links displayed now that link and post categories have been blended.
Am I just overlooking something, or is this feature gone?
-
I’ll try what Vince said. I have no plans to roll back to pre 2.1. I purged a few plugins which never quite worked right or as well as I would have liked concerning comments. I tried updating them first, but I think I’m done with OpenID and possibly Gravatars too.
I still think having to add three complicated lines of PHP to my template to replace one simple line is a step backwards. I built my own theme based on advice and examples from others and it used:
<?php get_links_list(); ?>
This wasn’t a philosophical decision, this is probably what someone else did and I just did the same. I’m also surprised how many people posted so quickly on this thread. There must be people who liked the pre 2.1 way and prefer clicking things rather than pulling out a text editor and an ftp client.
The assumption that the “2.1 way” requires editing the template by hand is unfounded. It does *now* because 2.1 is still new. The paint isn’t even dry yet. Eventually, it will not require such things, because plugins and sidebar widgets will fill the gap. And the template code will be better able to specify consistent design because of it.
I tried using the category_name argument instead of categor number and it didn’t seemed to work. The category is named Blogroll and the slug is blogroll. I tried it with and without capitalizing the B. I think using name is superior to having to look up the number and I don’t like mixing link categories with blog posting categories at all.
Unless you look to the right and notice that there are 0 posts but 10 links how do you tell the two types apart? They should at least be visually distinctive or in seperate lists or something.
Any thoughts on why the third category has no title, though the CSS styling is partly there. It should be titled “Links”.
My URL: https://blog.muschamp.ca/
My PHP snippets:
<?php wp_list_bookmarks('category=55&before=
<li>&after=</li>
&show_images=0&show_description=0&orderby=updated'); ?>
<?php wp_list_bookmarks('category=57&before=
<li>&after=</li>
&show_images=0&show_description=0&orderby=rand&limit=5'); ?>
<?php wp_list_bookmarks('category=56&before=
<li>&after=</li>
&show_images=0&show_description=0&orderby=name'); ?>Damn less thans and greater thans. PHP has fugly syntax IMO.
Backticks!!!
(why nobody ever reads how to post code? – just below the text input area)… and I don’t like mixing link categories with blog posting categories at all.
Unless you look to the right and notice that there are 0 posts but 10 links how do you tell the two types apart? They should at least be visually distinctive or in seperate lists or something.
You’re making an assumption that they are separate things. Why do they have to be separate? I think they should be better integrated. What if I wanted to make posts and links in the same category?
All a category really is is a name that can be applied to an entry. Whether that entry is a link or whether it is a post shouldn’t make any difference.
I grant you that 2.1 is still inconsistent in this arena. Hopefully it will be better integrated in later revisions, and this separation will no longer exist.
I have to disagree with you here. Stop thinking WordPress and start abstracting. A link is something everyone is familiar with it is text (or an image) with a URI pointing to a resource. A post is an article consisting of text, images, embedded video, and links.
Quite different beasts which is why I think they should visually distinctive at least.
Now a third object is present a category. What is a category? Is it a link? No. Is it a post? No. A category is an attribute, a grouping, a tag, maybe a set is the best way to think of it. Following your logic a link and a post could belong in the same set so that makes them not homogenous. Sets could however consist of just links or just posts. Posts can be in more than one category, can links? But none of this is a reason they can’t be visually distinctive in the admin UI at the least.
A category is neither a link nor a post. So you have three object/tables/concepts. I’ve never taken a close look at the database structure in WordPress but I assume these three concepts are not all in the same table, that wouldn’t be good relational database design.
Categories can contain links and posts apparently, but posts can contain links. I know they are HTML links and not the wordpress concept of links, ie bookmarks or blogrolls, but links have become ubiquitous and something needs to be done whether visually or verbally to make the bookmarks or sidebar links distinctive and illuminate how they interact with categories become more apparent, especially considering an entire screen seems to have been removed from the program.
Posts can be in more than one category, can links?
From the perspective of the database, yes, they can, now. Don’t know if the UI has adapted to it yet though.
As for the rest of your post, I just disagree. I think that some work needs to be done to it, but not the same work you seem to think needs to be done there.
The Links page has always been the backward child in WordPress, IMO. It’s been largely underutilized because it never made much sense. Most people only use it for the rather limited purpose of having links on their sidebars. But from a wider perspective, it’s really a generic URI library. A place to put a bunch of URIs, organize them, and then to display them in whatever way is appropriate. I do like the name “Bookmarks” better, because that has the association with Browser bookmarks, and to a wider extent, something like del.icio.us.
From that perspective, separating categories from it and merging with the normal categories makes a lot of sense. It brings the lowly Link up to the same level as the Post. It’s another type of item you can enter into the system and then have automatically displayed and categorized with the rest of the things on your blog.
I think it would be neat, for example, to be able to insert bookmarks directly between posts, as part of the normal blog-flow. You could use them for links that you find interesting but don’t feel like writing a full post about. Kinda like “Asides”, but just the URI and a brief description.
The “RSS” field has always been underutilized in the Links as well. If you could have it autodetect blog links and grab the feeds, then your Blogroll could not only show links to the blogs you have there, but also the title of their latest posts. Could even order the list by the time of their latest posts.
In other words, I’m happy that finally the links are getting a revamp. It could turn into something very nice. Better than leaving it stagnant and dead, like it was.
The problem as I see it is not in the Bookmarks functionality. It’s much the same as the old “Links” worked. The problem is in the way that post categories and link categories have been combined into one “category” attribute with no way to differentiate between what is a post and what is a link.
If “category” can be an attribute of either post or link, it’s just a valid to say that something called “type” (i.e. post or link) is an attribute of category.
Personally, I liked it that way. It worked exactly the way I wanted it to.
Posts are posts and links are links. I’m not too happy about having to modify my template to exclude something from my list of post categories every time I add a new link category. But that’s seemingly the only way that I can list only post categories without stray link categories getting into the act.
Telling unhappy customers to go back to 2.07 (hope you backed up your database first) and wait for vaporware in the form of widgets or plugins doesn’t seem like very good customer service.
And while we’re on the subject, if category is such a universal attribute, why is it still not possible to assign a category to a page? Being able to do that would allow me to get rid of at least one plug-in.
Posts are posts and links are links. I’m not too happy about having to modify my template to exclude something from my list of post categories every time I add a new link category. But that’s seemingly the only way that I can list only post categories without stray link categories getting into the act.
This appears to be an oversight that may or may not be remedied in the next new release. I can see a couple of possible solutions, but I’m uncertain what changes would be necessary to make it work right there. Categories are not finalized, I’m guessing.
Telling unhappy customers to go back to 2.07 (hope you backed up your database first) and wait for vaporware in the form of widgets or plugins doesn’t seem like very good customer service.
Good job you didn’t pay for any of this then, isn’t it? Complaining about “customer service” when the software is free and the people who volunteer to answer questions on this forum don’t get any compensation… well, it just makes me kinda want to ignore what you’re saying. If you were actually paying money for any of this, then you’d have more room for that sort of thing. As it is, you’re quite free to modify the software yourself or go find somebody else to do it for you. The code is free as in speech.
And while we’re on the subject, if category is such a universal attribute, why is it still not possible to assign a category to a page? Being able to do that would allow me to get rid of at least one plug-in.
There is no technical reason. The database would allow for it with no troubles. It’s just that the UI kinda assumes that pages are standalone and hierarchical in terms of other pages. They are undated as well, you’ll notice. If you could categorize a page, would that page content show on the category archive pages? If you could put a date on it, would it show up in the date-based archive pages? Questions like that are unanswerable because there are valid reasons to do it either way. So Pages don’t get dates and they don’t get categories. They are meant for static, standalone, content which lies outside of the rest of the date and category based hierarchical organization.
I’d forgotten about ‘Pages’ as I don’t use them. My static stuff is still done by hand, I created a WordPress theme to match it…
I still think there is some confusion in the user and developer community about what the basic concepts are and what they are used for. There appear to be two types of links, links that I just type in while composing a post or a page. ?? And links that are important enough to be in the sidebar or between posts and assigned a category. With the exception of a category is there any real difference between the links? Does the category from the post envelop the links inside the post?
Posts can have multiple categories while links can not and apparently pages can’t have any.
Then there are links built into the themes themselves. The over use of the term link is problematic, but using blogroll isn’t an improvement as a link can be to so many other things than a blog.
I’m not losing any sleep over all this, I have much bigger problems. I edited my template, I didn’t care to have to look up the category number not when I knew the name and expected it work given that instead. It is still not working correctly for the third link category which was titled “Links”. I viewed source it creates an H2 tag, but puts nothing in it. It works for my other link categories. It isn’t a rendering issue, nothing gets put in the H2 tag, not even white space.
Posts can have multiple categories while links can not and apparently pages can’t have any.
I would like this to be something added as well, to allow Bookmarks to be in multiple categories.
I still think there is some confusion in the user and developer community about what the basic concepts are and what they are used for.
You’re right on with that there. And that confusion has existed for a long time. I think the changes going in are a start to ending that confusion.
And it would really help if everybody would stop calling them “Links”. Use the term “Bookmarks” instead. It distinguishes them from “links” in a post, which are nothing at all. They’re just part of the post, not separate from it in any way, not treated special by anything except the pingback mechanism.
In programmer-ese… One of the great things I’ve noticed about the 2.1 release is, overall, a move more toward the Model-View-Controller architecture. The bookmarking feature used to have settings for its view in the administrative interface. Due, as you say, Otto, to confusion among theme developers (and even a misuse of some tags), these controls were removed as they were not in use. Having said that, I would argue that they were in use, and properly too, by some subset of themes, as many of us immediately noticed the new functionality. While I certainly thank you and the other developers from the bottom of my heart for making such a fantastic free product, I think the main grumbling comes from this perceived functionality gap from the previous version. As a developer myself, I carefully read through the change notes and didn’t see anything warning me in advance that I’d lose functionality I had before, so I (and obviously others) made the assumption that this was a bug or oversight. Obviously this was an error on our part. To preserve the harmony between users of the fine product and its heroic developers, perhaps you could point us to the appropriate documentation to review before we start asking about what we see as missing features?
Thanks again!And it would really help if everybody would stop calling them “Links”. Use the term “Bookmarks” instead. It distinguishes them from “links” in a post, which are nothing at all.
The tags may refer to them as “Bookmarks,” but the Admin interface now calls them “Blogroll” and still uses the term “add link.” Many people are going to refer to them that way because that’s what they see in the admin interface.
I would like this to be something added as well, to allow Bookmarks to be in multiple categories.
Blogroll links can be in multiple categories in 2.1.
Good job you didn’t pay for any of this then, isn’t it? Complaining about “customer service” when the software is free and the people who volunteer to answer questions on this forum don’t get any compensation… well, it just makes me kinda want to ignore what you’re saying. If you were actually paying money for any of this, then you’d have more room for that sort of thing. As it is, you’re quite free to modify the software yourself or go find somebody else to do it for you.
I’m not complaining about this forum or the support here. Like many 2.1 adopters, I took my lumps and revamped my theme and got my site back up in something less than 24 hours.
What I’m complaining about the fundamental changes made in 2.1 that were not adequately (my opinion) warned against on the download page. “Because it’s free” isn’t a good excuse for lack of communication when there’s a large population that might stumble into problems.
Tens of thousands of people (hundreds of thousand?) use WordPress. It’s easy to use and install, so people that aren’t techie and need easy to use and install products will be drawn to it.
But, it seems like every time I open up the wordpress.net site there’s a “hurry and download because of security flaws” message. There was nothing to warn that 2.1 was different… OK… security flaws… gotta download and install right away!
I just run a little knitting blog with maybe 100 visitor/day. It’s a tiny thing, and I know that in the scheme of the blogosphere I’m pretty insignificant. I use WP because it’s free — it’s all I can afford. And fortunately I know enough to be able to fix broked things. Sometimes. But what about all those people that can’t? That’s what I’m trying to point out.
- The topic ‘2.1 – Restrict # of links shown in each category?’ is closed to new replies.