What best practices should be followed when linking PHP includes to different pages within a website to ensure smooth functionality and user experience?

When linking PHP includes to different pages within a website, it is important to set the correct file paths to ensure smooth functionality and user experience. Using relative paths and including files based on the root directory can help maintain consistency across pages and prevent broken links.

<?php
include_once($_SERVER['DOCUMENT_ROOT'] . '/path/to/your/include/file.php');
?>