Woothemes Canvas – Duplicate business page template whilst retaining slider functionality

57 Views Asked by At

Designer and CSS/HTML guy here.

I'm using Woothemes Canvas and have experience customising themes in Wordpress (as well as CSS and HTML knowledge) however I am not php literate so am hitting a bit of a wall.

I follow the best practices when it comes to using child themes etc. and have created custom page templates before (albeit by duplicating existing templates that are more-or-less what I need as a starting point).

First, I'll just explain what I am trying to do: I'm using the Canvas 'Business' page template on the home page which effectively adds a slider to the page. Now, because I'm using the Advanced Custom Fields plugin, I'd like to dupliacte this page template file and edit it to pull in some values from ACF.

Now the problem: when I copy the 'template-biz.php' file and rename it something else, Canvas seems to no longer recognise it in the same way – with the effect being I lose the ability to select slide groups etc. from the Wordpress edit page (which you can usually do with the business template). To clarify – the slider still displays on the front end page, I just no longer have the ability to select slide groups in the back end edit page.

Now I'm guessing it's something to do with the fact that I've renamed the template and therefore a link has broken somewhere so Canvas doesn't know to treat this duplicated template in the same way as the original business template.

Any thoughts or help with this would be great!

1

There are 1 best solutions below

4
On

I guess you need to change template name too.

<?php
/**
 * Template Name: my custom page
 *
 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since Twenty Fourteen 1.0
 */

and assign as usual.

enter image description here

EDIT

You cannot see because slider group is only for Business Template. (Based on)

So yes, You cannot use slider group with the duplicate template. One thing you can do is, in template-biz.php create a if-else condition with slug.

global $post;
$post_slug=$post->post_name;

/* let your duplicate page slug is 'custompage' , $post_slug would be custompage*/

if($post_slug=="custompage"){

/* copy all the template and you can change whatever you want */

} else {

/* let the original/untouched code be here */

}

Dont forget to keep backup first. Hope this idea would surely help you. Thanks