Template Overrides
Customize how references appear on your site by overriding plugin templates in your theme.
Template Override System
Academic References uses a template hierarchy similar to WooCommerce. Plugin templates can be overridden by placing modified copies in your theme.
Template Locations
Plugin Templates
Original templates are in:
wp-content/plugins/academic-references/templates/
Theme Overrides
Copy templates to your theme:
wp-content/themes/your-theme/academic-references/
Or in a child theme:
wp-content/themes/your-theme-child/academic-references/
Available Templates
Archive Templates
| Template | Description |
|---|---|
archive-reference.php | Reference archive page |
archive-collection.php | Collection archive page |
category-reference.php | Reference category archive |
Single Templates
| Template | Description |
|---|---|
single-reference.php | Single reference page |
single-collection.php | Single collection page |
Content Templates
| Template | Description |
|---|---|
content-reference.php | Reference content in loops |
content-reference-card.php | Card layout for references |
content-reference-list.php | List layout for references |
Component Templates
| Template | Description |
|---|---|
citation.php | Inline citation output |
bibliography.php | Bibliography block output |
bibliography-entry.php | Single bibliography entry |
Frontend Templates
| Template | Description |
|---|---|
dashboard.php | User dashboard container |
dashboard-references.php | Reference list in dashboard |
dashboard-collections.php | Collections in dashboard |
submission-form.php | Frontend submission form |
Creating an Override
Step 1: Locate the Original
Find the template you want to override in:
wp-content/plugins/academic-references/templates/
Step 2: Copy to Theme
Copy to your theme’s academic-references folder:
mkdir -p wp-content/themes/your-theme/academic-references/
cp wp-content/plugins/academic-references/templates/single-reference.php \
wp-content/themes/your-theme/academic-references/
Step 3: Modify the Template
Edit the copied template. Your changes will be used instead of the plugin version.
Step 4: Verify
Visit the relevant page to confirm your template is being used.
Template Structure
Basic Template
" >
Using Template Parts
Load sub-templates with:
abt_template_part( 'part-name' );
abt_template_part( 'part-name', array( 'data' => $value ) );
Template Variables
Templates have access to these variables:
In Single Reference
// Reference post object
$post
// Reference data array (CSL format)
$reference = abt_get_reference_data( get_the_ID() );
// Formatted citation
$citation = abt_get_formatted_citation( get_the_ID() );
// Reference meta
$doi = get_post_meta( get_the_ID(), '_abt_doi', true );
$url = get_post_meta( get_the_ID(), '_abt_url', true );
In Archive/Loop
// Query object
$wp_query
// Current reference in loop
$post
// Reference data
$reference = abt_get_reference_data( get_the_ID() );
In Dashboard
// Current user
$current_user
// User's references
$user_references = abt_get_user_references( $current_user->ID );
// Reading status
$reading_status = abt_get_user_reading_status( $current_user->ID, $reference_id );
Template Functions
Display Functions
// Output formatted citation
abt_the_citation( $reference_id, $style = null );
// Output reference title
abt_the_reference_title();
// Output authors
abt_the_reference_authors();
// Output abstract
abt_the_reference_abstract();
// Output reference link
abt_the_reference_link( $reference_id, $text = '' );
// Output reference metadata
abt_the_reference_meta( $field );
Get Functions (return values)
// Get reference data
$data = abt_get_reference_data( $reference_id );
// Get formatted citation
$citation = abt_get_formatted_citation( $reference_id, $style );
// Get reference permalink
$url = abt_get_reference_permalink( $reference_id );
// Get reference type label
$type = abt_get_reference_type_label( $reference_id );
Conditional Functions
// Check if viewing reference
if ( abt_is_reference() ) { }
// Check if reference has DOI
if ( abt_reference_has_doi( $reference_id ) ) { }
// Check if reference has abstract
if ( abt_reference_has_abstract( $reference_id ) ) { }
Example Overrides
Custom Single Reference
Abstract
Custom Bibliography Entry
Custom Card Template
CSS Classes
Templates use consistent CSS classes:
Containers
.abt-reference– Single reference wrapper.abt-reference-archive– Archive wrapper.abt-bibliography– Bibliography wrapper.abt-citation– Citation wrapper.abt-dashboard– Dashboard wrapper
Components
.abt-reference-title– Reference title.abt-reference-authors– Authors display.abt-reference-abstract– Abstract text.abt-reference-metadata– Metadata section.abt-bibliography-entry– Individual bib entry
States
.abt-favorite– Favorited reference.abt-reading-{status}– Reading status class.abt-type-{type}– Reference type class
Best Practices
- Start with copy – Never edit plugin templates directly
- Use child themes – Overrides survive theme updates
- Check versions – Plugin updates may change template structure
- Use hooks first – Prefer hooks for small changes
- Test thoroughly – Check all reference types and views
Troubleshooting
Template not being used
- Verify file path is correct
- Check file name matches exactly
- Clear any caching
Missing data in template
- Verify variable names
- Check if data exists for reference
- Use
var_dump()to debug
Styling issues
- Check CSS class names
- May need to add theme styles
- Plugin CSS may have higher specificity
Next Steps
- Hooks & Filters – PHP customization
- REST API – Data access
- Display Settings – Appearance options
