WordPress.org

Forums

WP Favorite Posts
overriding page template in child theme (2 posts)

  1. spectrus
    Member
    Posted 3 years ago #

    Hi,

    Just realized that the check on line 197 in wp-favorite-posts.php does not work if you're using a child theme. Here's the portion of code concerned:

    if (@file_exists(TEMPLATEPATH.'/wpfp-page-template.php')):
            include(TEMPLATEPATH.'/wpfp-page-template.php');
        else:
            include("wpfp-page-template.php");
        endif;

    I had to modify it in order for it to get the proper path for child theme directory. Here it is:

    if ( @file_exists(TEMPLATEPATH.'/wpfp-page-template.php') || @file_exists(STYLESHEETPATH.'/wpfp-page-template.php') ):
            if(@file_exists(TEMPLATEPATH.'/wpfp-page-template.php')) :
                include(TEMPLATEPATH.'/wpfp-page-template.php');
            else :
                include(STYLESHEETPATH.'/wpfp-page-template.php');
            endif;
        else:
            include("wpfp-page-template.php");
        endif;

    I recommend putting it into the next plugin release, since child themes are quite a popular feature of WP, and it would be nice if the plugin was working properly with them.

    http://wordpress.org/extend/plugins/wp-favorite-posts/

  2. Huseyin Berberoglu
    Member
    Plugin Author

    Posted 3 years ago #

    Hi, thanks for your code :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Favorite Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic