Template Overrides
Change the HTML a classic view prints, without touching plugin files, by copying a template into your theme.
Sometimes CSS isn't enough. You need a different heading level, an extra data- attribute for analytics, or markup that matches your design system exactly. For those cases the classic version prints its HTML through small templates you can override from your theme.
A template here is a short PHP file that prints one piece of a view: the wrapper, one logo, a title, the popup. Copy it into your theme, edit your copy, and the plugin uses yours instead. Plugin updates replace the originals but never touch your theme, so your change survives.
Classic version only
Template overrides apply to the [logocarousel] shortcode and its views: the Classic version.
The blocks have no template overrides. Carousel, Grid, List, Marquee and Table build their HTML in PHP classes with no template layer, so copying a file into your theme does nothing to a block. To change a block, use the inspector, Custom CSS & JS, or the hooks.
How the override works
When the classic renderer needs a template, it asks WordPress for your copy first and falls back to its own:
wp-content/themes/your-child-theme/logo-carousel-pro/templates/<file>← your copy winswp-content/themes/your-parent-theme/logo-carousel-pro/templates/<file>wp-content/plugins/logo-carousel-pro/src/Frontend/views/templates/<file>← the shipped default
Steps 1 and 2 are WordPress's own locate_template(), so the usual child-theme rules apply.
The rule for the path: take the file's path below src/Frontend/views/templates/ and put it below logo-carousel-pro/templates/ in your theme. Keep any subfolder, such as loop/content/.
Don't trust every header comment
Most templates say where to copy them in their opening comment, but a few comments name the wrong path. For example, loop/single-item.php says loop/single-content.php, and not-found-text.php says item/title.php. Always use the file's real path, as listed in the tables below.
Your first override, step by step
Let's change the classic section title from an <h2> to a <p> styled as a heading, so it doesn't break your page's heading order. (A page reads best with one <h1> and a logical order of headings under it.)
1. Find the original.
wp-content/plugins/logo-carousel-pro/src/Frontend/views/templates/section-title.php2. Create the folders in your child theme. Note the prefix is logo-carousel-pro/templates/, not src/Frontend/views/templates/:
wp-content/themes/your-child-theme/logo-carousel-pro/templates/3. Copy the file in, unchanged, and reload a page with the view. Nothing should look different. This proves the plugin found your copy before you start editing.
Prove the override is live
Add <!-- my override --> at the top of your copy and look for it in the page source. If it's not there, the file is in the wrong place. Remove the comment once you've checked.
4. Make your change in your copy:
<?php
if ( $section_title && $main_section_title ) {
?>
<p class="sp-logo-carousel-pro-section-title" role="heading" aria-level="2"><?php echo wp_kses_post( $main_section_title ); ?></p>
<?php
}Keep the sp-logo-carousel-pro-section-title class. The plugin's stylesheet and your typography settings target it.
Templates you can override
Layout wrappers
Each Layout Preset has one wrapper that prints the outer markup for the whole view. Editing a wrapper affects every logo in it.
| File | Used by the Layout Preset |
|---|---|
carousel.php | Carousel and Multi Rows |
grid.php | Grid and Masonry |
filter.php | Isotope |
list.php | List |
inline.php | Inline |
table.php | Table |
Shared pieces
| File | Prints |
|---|---|
section-title.php | The section title above a view |
preloader.php | The loading spinner |
search-form.php | The Ajax search box |
live-filter-buttons.php | The live-filter buttons (categories and A–Z) |
pagination.php | Pagination controls |
not-found-text.php | "No logos found" |
popup.php | The logo detail popup |
One logo
| File | Prints |
|---|---|
loop/single-item.php | One logo, start to finish (all layouts except Table) |
loop/content/image.php | The logo image and its link |
loop/content/image-list.php | The logo image in the List layout |
loop/content/logo-details.php | Title and description area |
loop/content/logo-details-list.php | Title and description area in the List layout |
loop/content/title.php | The logo title |
loop/content/content.php | The logo description |
loop/content/read-more.php | The Read More link or button |
Table layout
| File | Prints |
|---|---|
table/header.php | The table header row |
table/item.php | One table row |
table/content/logo.php | The logo cell |
table/content/logo-title.php | The title cell |
table/content/logo-details.php | The description cell |
What you can't override
These files are loaded directly, not through the template lookup, so a copy in your theme is ignored: views/partials/settings.php, views/partials/items.php, views/partials/table-items.php, views/partials/contact-us-button.php and views/partials/dynamic-style.php. The settings file reads the view's options, the items files run the logo loop, and the dynamic-style file prints the view's CSS.
Working with template variables
Templates are included, so they see whatever variables are already set: $post_id (the view's ID), $layout, $link_type, $logo_link, $hover_class and many more. There's no documented list, and each template uses different ones. Read the file you're overriding before you change it.
// Guard anything you're not sure is set.
if ( ! empty( $main_section_title ) ) {
// …
}// While developing only: list what's in scope. Never ship this.
echo '<pre>' . esc_html( print_r( array_keys( get_defined_vars() ), true ) ) . '</pre>';Because these variables are internal, they can change between releases.
Prefer a filter when one exists
An override freezes a copy of the markup in your theme. When the plugin improves the original, your copy doesn't get the fix and nothing tells you. So check the hooks first:
| If you want to change | Use this instead |
|---|---|
| The search placeholder | lcp_search_placeholder_text |
| The "no results" message for search | lcp_edit_no_result_found_text |
| The message after the last page | sp_lcp_pagination_end_content_text |
| The letters in the A–Z filter | lcp_atoz_rang |
| The order of category filter buttons | sp_logo_categories_filter_sort |
Override a template when you need different structure: extra wrappers, different elements, new attributes. Use a filter when you only need to change a value.
Real-world example: add a tracking attribute to every logo
Your analytics tool wants data-track="partner-logo" on each logo. Override loop/content/image.php and add the attribute to the wrapper div:
<div class="sp-lcp-logo-wrapper <?php echo wp_kses_post( $animation_class ); ?>" <?php echo wp_kses_post( $animation_attr ); ?> data-post-id="<?php the_ID(); ?>" data-track="partner-logo">Change only that line and leave the rest of the copied file as it is.
Keeping overrides healthy after an update
- Note the plugin version at the top of every override, for example
// Copied from Logo Carousel Pro 4.1.7. - Compare after major updates and bring across anything relevant:bash
diff -u \ wp-content/plugins/logo-carousel-pro/src/Frontend/views/templates/section-title.php \ wp-content/themes/your-child-theme/logo-carousel-pro/templates/section-title.php - Keep overrides few and small. Two careful overrides age far better than a copy of the whole folder.
- Never edit the plugin's own files. The next update wipes them.
Troubleshooting
My override is ignored. Almost always the path. It must be logo-carousel-pro/templates/… inside the active theme, mirroring the file's real path below src/Frontend/views/templates/. Don't follow a header comment that names a different path.
It works for one view but not another. Layouts use different files. A List view uses loop/content/image-list.php, not image.php; a Table view uses the table/ files. Check the view's Layout Preset.
The page is blank or shows an error. A PHP error in your copy breaks the page. Delete the file to confirm, then re-apply your edit in smaller steps on staging with WP_DEBUG on.
Nothing I do affects my block. Expected: blocks don't use templates. See the note at the top of this page.
Next steps
- Hooks: Actions and Filters: the lighter way to change output.
- Shortcodes and Block Attributes: placing views and templates from PHP.
- Classic overview: what the classic version can do.
- Custom CSS & JS: for presentation-only changes.