Untitled UI logotext
Solutions
WebsitesEcommerceMobile AppsWeb AppsProduction Support & Maintenance
Our work
Company
About usBlogPodcastContact us
Book a free consultation

Custom Single Page

Olivia Rhye

In a recent comment, we were asked if there is a way to do the custom single page based on the custom author page. Depending on your WordPress version, this may or may not be implemented already, but either way, the solution can be found below:

global $wp_query;
$curpost = $wp_query->get_queried_object();

if(file_exists('single-'.$curpost->ID.'.php'))
{
include('single-'.$curpost->ID.'.php');
}
else
{
//Default single page
}

The basic theory is the same, get the page ID. Check if single-ID.php exists. If it does, include it. If not, do default author code.

Ready to start a project?

Book a free consultation
Untitled UI logotext
Our work
About us
Blog
Careers
Submit a ticket
Agency Partnerships
Contact
© 2024 fjorge. All rights reserved.
Privacy