Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix layout issue with Academia theme #2773
The Academia theme, as per the issue linked above, seemed to have problems with our theme compatibility code. This stemmed from the fact that when we use a "dummy post" for rendering, we give it an ID of
I traced it through to the fetching of metadata, and I'm thinking it is related to this code, which returns
The solution I'm attempting here is to set the "dummy post" ID to a valid, non-zero number. That said, I do not want to set it to a number that is being used as a valid ID in the database, because I feel like that could cause other problems. Instead, I fetch the largest post ID currently in the database and add 1. This query should only be run once per request (I think?) so the performance penalty should be negligible.