• I have a static front page that lists the 3 latest articles from each category.

    Static Front Page Example

    Category Name
    
    Latest Article 1
    Latest Article 2
    Latest Article 3
    
    Category Name 
    
    Latest Article 1
    Latest Article 2
    Latest Article 3

    The Problem

    I don’t want the same author to appear twice on the front page like this:

    Category Name
    
    Latest Article 1 - Author 1
    Latest Article 2 - Author 1
    Latest Article 3 - Author 2
    
    Category Name 
    
    Latest Article 1 - Author 2
    Latest Article 2 - Author 3
    Latest Article 3 - Author 1

    The Solution

    Latest Article 1 - Author 4
    Latest Article 2 - Author 9
    Latest Article 3 - Author 2
    
    Category Name 
    
    Latest Article 1 - Author 1
    Latest Article 2 - Author 3
    Latest Article 3 - Author 6
Viewing 1 replies (of 1 total)
  • Thread Starter elfminster

    (@elfminster)

    So what I need is a way to be able to query the database to check if the 2nd article is by the same author as the 1st, and if it is to then check the next article and so forth until it finds an author that has not yet been displayed on the front page.

Viewing 1 replies (of 1 total)
  • The topic ‘Static Front Page – Never Same Author Twice’ is closed to new replies.