08/25/2013 at 6:23 pm
#268062
Keymaster
@ Wesley
Not a question that can answered easily because that really depends on the template you’re using as to which file you’ll have to edit. I’ve been building a pretty advanced template API; right now, there’s no docs other that the phpDoc that exists in the code. The only core template built using the new API is the Names template. All the premium templates do use the new API.
So, if you base your template off the Names template, you would add the following in the class construct:
$template->part( array( 'tag' => 'card_single', 'type' => 'file', 'path' => $template->getPath() . 'card-single.php' ) );
Then you would just create a new file; card-single.php
. I would just dupe the template.php
from the Default Card template and use that as a starting point.
To answer the question on how to detect a single entry, I use this:
if ( get_query_var( 'cn-entry-slug' ) { /* CODE HERE */ }