Custom code your link template

Need more than the template styling settings? It's also possible to code your own visual link template.

Adding a custom link template

You want to create the following directory structure in your (child) theme:

/vlp-templates/link/your-custom-template/

Inside that folder, create the following files:

  • your-custom-template.php
  • your-custom-template.css

These will automatically get loaded when the template is used. your-custom-template can be any name you want. Just make sure the file names match with the directory name.

How to code your custom link template

Inside the PHP file you'll automatically have the $link variable available to access the different properties.

Have a look at the default templates in the following plugin folder for example usage:

/visual-link-preview/templates/link/
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.