Skip to content

Instantly share code, notes, and snippets.

@wpperform
Last active January 29, 2017 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpperform/4416749 to your computer and use it in GitHub Desktop.
Save wpperform/4416749 to your computer and use it in GitHub Desktop.
Changes to Yet Another Related Posts Plugin to support templates in plugin templates folder instead of theme folder
// 5 changes to /classes/YARPP_Core.php for version 4.3.6
// each change involves commenting out 1 line and replacing with revised version
// near line 489
// $this->templates = glob(STYLESHEETPATH . '/yarpp-template-*.php');
$this->templates = glob(YARPP_DIR . '/yarpp-templates' . '/yarpp-template-*.php');
// near line 1121
// } else if ((bool) $template && file_exists(STYLESHEETPATH.'/'.$template)) {
} else if ((bool) $template && file_exists(YARPP_DIR . '/yarpp-templates/' . $template)) {
// near line 1124
// include(STYLESHEETPATH . '/' . $template);
include(YARPP_DIR . '/yarpp-templates/' . $template);
// near line 1309
// } else if ((bool) $template && file_exists(STYLESHEETPATH.'/'.$template)) {
} else if ((bool) $template && file_exists(YARPP_DIR . '/yarpp-templates/' . $template)) {
// near line 1313
// include(STYLESHEETPATH . '/' . $template);
include(YARPP_DIR . '/yarpp-templates/' . $template);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment