1

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!

Dan204
  • 11
  • 1

1 Answers1

0

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

Bilal Hussain
  • 994
  • 1
  • 10
  • 25
  • Thanks for the response! Unfortunately I'd already done that. Here are some screen shots of the issue, note when the template is changed, the 'slide group' section dissapears (even though it is an exact duplicate). https://postimg.org/gallery/2m77aouo6/ – Dan204 Sep 07 '17 at 10:18
  • you need to create a new page with default Business template. – Bilal Hussain Sep 07 '17 at 10:50
  • Thanks for getting back to me on that! Would you mind clarifying what that code does? Do I need to add that to a new template php file or directly in the template-biz.php? – Dan204 Sep 07 '17 at 11:02
  • You can call it in `template-biz.php` and we are using if else condition so it would not change default behaviour of Business page. – Bilal Hussain Sep 07 '17 at 11:47