Smart Post Show Pro

  1. Home
  2. Docs
  3. Smart Post Show Pro
  4. How To Override Templates

How To Override Templates

Smart Post Show Pro supports template overriding from a theme. That means you can change the appearance of the plugin-specific designs. The overrideable files are located in the templates folder. Here is a hierarchy for you-

smart-post-show-pro/ 
├── public 
│ ├── templates 
│ │ ├── item/ 
│ │ │ ├── content.php 
│ │ │ ├── meta-over-title.php 
│ │ │ ├── meta.php 
│ │ │ ├── over-thumb-taxonomy.php
│ │ │ ├── product-cart.php
│ │ │ ├── product-price.php
│ │ │ ├── product-rating.php
│ │ │ ├── read-more.php 
│ │ │ ├── social-share.php 
│ │ │ ├── thumbnail.php 
│ │ │ ├── title.php
│ │ ├── block.php 
│ │ ├── carousel.php 
│ │ ├── collapsible.php 
│ │ ├── filter-bar.php 
│ │ ├── filter.php 
│ │ ├── grid.php 
│ │ ├── list.php 
│ │ ├── pagination.php 
│ │ ├── preloader.php 
│ │ ├── section-title.php 
│ │ ├── timeline.php 
│ │ ├── zigzag.php

So all the files mentioned above can be overridden from your theme.

Steps to override a template of Smart Post Show:

  1. Make a folder named “smart-post-show-pro” in your active theme. (It is better to create the folder in your active child theme)
  2. Create another folder inside the “smart-post-show-pro” and name it templates.
  3. Copy the template you want to override from the templates folder of the plugin.
  4. Paste the template file in the smart-post-show-pro > templates folder inside your active theme.
  5. Now open the file in a text editor and edit as you like.
  6. Now reload the page from the browser and see the changes you made.

Say, for example, I want to override the carousel.php file through my child theme.

Here noteworthy: it’s highly recommended to override the file through the child theme instead of the main theme. Otherwise, the file customization will get reverted to the original once any theme update happens.

So to override the content.php file, you have to copy the file from

/wp-content/plugins/smart-post-show-pro/public/templates/item/content.php

and paste it into your child theme directory

wp-content/themes/twentytwenty-child/smart-post-show-pro/public/templates/item

/content.php

Then modify the file content as you want.