Thread Starter
makapa
(@makapa)
Hi,
I don’t know how but it now works for the filterable template page – following the documentation the plugin creator made.
http://otwthemes.com/online-documentation-otw-portfolio-light-plugin/?utm_source=wp.org&utm_medium=page&utm_content=docs&utm_campaign=otw-p#templates
But I can’t modify the otw-portfolio-post template file in my active theme folder to do the same thing following the documentation (only from the plugin template folder).
Any idea? Thanks
Hi support
I have got the same problem, it simply doesn’t look at the customised files in my theme.
I just tested it and placed the file in my theme folder instead of the child theme folder and it works. So the problem is the child theme.
How can we adjust it to work with the child theme, as obviously the file will be lost if we update the theme.
I really like your plugin and would like to get this working for me.
Any assistance would be greatly appreciated.
kind regards
Regine
Hi Support
I had a developer looking at the problem with the redirection to the original theme folder instead of the child theme folder.
He amended the code in the file otw-portfolio-light.php so that it looks now for the stylesheet_directory name, which is the child theme, and then redirects to this folder.
Here the code for anybody who wants to have it looking at the child theme:
In the file otw-portfolio-light.php replace everything from line 423 to 447 with the following code. Any lines that have been added or updated are commented with // ARC …
It would be great if that could be updated in the plugin, if there is an update coming out.
Thanks
Regine
/*———————————————————————————–*/
/* Portfolio SHORTCODE [otw_portfolio], [otw_portfolio otw_filterable] */
/*———————————————————————————–*/
add_shortcode(‘otw_portfolio’, ‘otw_portfolio_shortcode’);
function otw_portfolio_shortcode( $atts ) { }
add_action( ‘template_redirect’, ‘otw_template_redirect’ );
function otw_template_redirect() {
global $post;
$tdir=get_template_directory(); // ARC added
$ssdir=get_stylesheet_directory(); // ARC added
$dir=file_exists($ssdir.”/otw-prtfolio-filterable.php”)?$ssdir:$tdir; // ARC added
if (strpos($post->post_content, ‘otw_portfolio’) && strpos($post->post_content, ‘otw_filterable’) ) {
if ( file_exists( $dir.’/otw-prtfolio-filterable.php’ )) { // ARC updated
include( $dir.’/otw-prtfolio-filterable.php’ ); // ARC updated
} else {
include( plugin_dir_path( __FILE__ ).’templates/otw-prtfolio-filterable.php’ );
}
exit();
} else if ( strpos($post->post_content, ‘otw_portfolio’) ) {
if ( file_exists( $dir.’/otw-portfolio-paginated.php’ )) { // ARC updated
include( $dir.’/otw-portfolio-paginated.php’ ); // ARC updated
} else {
include( plugin_dir_path( __FILE__ ).’templates/otw-portfolio-paginated.php’ );
}
exit();
}
}
Hi Regine,
That issue was driving me crazy. Thanks so much for your contribution. Now my modified templates are finally working 🙂
Regards.
Thank you so much, nutsonshells. Your code pointed me in the right direction, but the way I did it is to replace all get_template_directory() with get_stylesheet_directory() inside otw-portfolio-light.php.