How to Randomize the featured listing plugin

Discussion in 'Customizations' started by markstanden, Feb 6, 2011.

  1. markstanden Customer

    Hi Everyone,

    Found a neat way to make the featured listings plugin on the home page to show random featured listings.

    If you open the file home.tpl which can be found in your template folder, towards the bottom you will see the following code, yours may differ slightly depending on which template you are using.

    {feature_listings_horizontal number=8 cols=4 table_attr='width="100%" cellpadding="3" cellspacing="3"' td_attr='style="border-top: 1px dashed #999;"' order_by='rand()'}

    Just change the order by code to whats in RED, save the file and reupload.

    This works on v4.1.10

    Hope this helps someone, this was something i was trying to achieve for ages and finally got it sorted.

    Regards
    Mark
  2. seymourjames All Hands On Deck

    I thought it already was generating the ads randomly?
  3. markstanden Customer

    Hi David,

    Not in the default template, it was sorting by date added, descending. Original code below.


    {feature_listings_horizontal number=8 cols=4 table_attr='width="100%" cellpadding="3" cellspacing="3"' td_attr='style="border-top: 1px dashed #999;"' order_by='dateadded' order='desc'}


    Mark
  4. Mike-N-Tosh Developer & Moderator

    That is true for versions 4.1 and earlier, but not in 4.2 and later which is random.
  5. darkqueen Customer

    Hi. I have v4.2.4 Developer and it is not random ever. Does anyone know why?
  6. Mike-N-Tosh Developer & Moderator

    Please ONLY ASK YOUR QUESTION ONCE in one forum only. It serves NO PURPOSE to post it in multiple forums.

Share This Page