Truncating Category Visible Listings to a Reasonable Quantity (Prevent a Link Farm)
Hi Matt:
On 2/5/2014 you sent me the following message to my email address because I needed help removing some of the links in the vantage listings. Unfortunately the solution that you provided removed ALL of the category listings, not just display 3 as the line of code appears to do: (The message that you wrote to me on 2/5 is between the asterisks. Please see my request after the asterisks)
*****
I don't have time to test properly but this quick fix limits categories displayed:
You need to edit the core file: themes/vantage/includes/template-tags.php
Around about line 40 you should see this line of code:
$cats_list = implode( ', ', $_cats);
Directly above that line copy and paste this:
$_cats = array_slice( $_cats, 0, 3 );
Change the number 3 to the maximum number of categories you want to display.
*****
The number of listings is NOT successfully controlled by changing this number. Is there a way to do this correctly?
Also, what I would be more interested in would be some sort of plugin to do something similar. Let me explain. For example, if a listing is a member of lets say 23 categories, a plugin could be made to display the first 4 categories. But after the 4th category, a hyperlink that said something like "View More..." which could be clicked and allow the website visitor to see ALL of the categories (as if no code modification was ever made). But in this expanded view (lack of a better word) there would be a "View Less" link at the end of all the categories that are listed.
A Plugin would also be ideal because every time Vantage updates, it cancels out the mod that you posted.
I appreciate your help in this. Thank you in advance Matt!