Skip Navigation

[Resolved] Page Template Help

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 8 replies, has 2 voices.

Last updated by Waqar 4 years, 12 months ago.

Assisted by: Waqar.

Author
Posts
#1670081

Hi!

The theme page template that Toolset is using is pulling information that's not needed, like a sidebar. Basically, when a regular page is added there is an option to turn off the sidebar. However, when creating a Content Template with Toolset, it does not show this option within the Block builder.

How can I ensure all custom post types / Content Templates have full-width?

Initial thought is to create a new page.php specially for Toolset?

If this can be done, let's call it toolset-page.php. How do I "tell" Toolset to use this toolkit-page.php?

#1671781

Hi,

Welcome to Toolset support and I'd be happy to assist.

Usually, themes include some built-in features or settings to enable/disable sidebar for specific post types.

Can you please share information about the theme that you're using?

I'll be in a better position to guide you after some testing and research accordingly.

regards,
Waqar

#1672645

Hi Waqar,

Thanks for responding! I'm using the theme "Homey" -- hidden link.

There are various page layouts that can be used. Specifically one that they've titled "Visual Composer", which is a semi full-width page with no sidebars. Even though VC elements and Toolset elements should not be used on the same page, this should be the page template that could be used for Toolset Content Templates.

The theme does have additional built-in page templates, but the custom post types obviously do not have access to those.

• Website I'm working on is: dev.visitkiawah.com.

• Dining Options using Toolset view: hidden link

• Listing Page (where I'd like to remove the sidebar and other information that's pulling from the "Default Page Template"): hidden link

Thanks again for your help 🙂

Best,
Cathryn

#1673443

Hi Cathryn,

Thank you for sharing these details.

I'm afraid, I'm not familiar with this particular theme, but if you could share your website's clone or just the theme files, I'll be able to test it on my own server to suggest the best way forward.
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

I've set your next reply as private again.

regards,
Waqar

#1675181

So I'm debating between creating a separate post template for the "custom post types" created through Toolset.

OR, I've found this: https://toolset.com/documentation/beyond-pages-program/adding-custom-type-compatibility-to-your-theme/

What is your recommendation after viewing the theme files? Or which would make the most sense from above?

#1675355

Hi Cathryn,

Thank you for sharing the duplicator package.

From looking into the theme's "single.php" file, I've noticed that it adopts a fairly simple logic to show sidebar on the single post pages (for all post types, except for "Listings").

It shows the sidebar only if at least one widget is placed in the widget area named "Blog Sidebar". If it is empty, then those single post pages show in full-width (i.e. without a sidebar).

Based on this you have a couple of options (ordered by simpler to complex):

1. If you'd always like to show all single post pages for all post types other than "Listings", you can empty the widget area named "Blog Sidebar".
(WP Admin -> Appearance -> Widgets)

2. If you'd always like to show all single post pages for all post types other than "Listings" without relying on the "Blog Sidebar" widget area, you can copy the "single.php" file from the parent theme folder "homey" into the child theme folder "homey-child" and then in that newly placed file replace the code from line# 12 - 15, from:


$content_classes = "col-xs-12 col-sm-12 col-md-8 col-lg-8";
if(!is_active_sidebar('blog-sidebar')) {
    $content_classes = "col-xs-12 col-sm-12 col-md-12 col-lg-12";
}

To only:


$content_classes = "col-xs-12 col-sm-12 col-md-12 col-lg-12";

And then also remove the code from line# 107 - 113:


<?php if(is_active_sidebar('blog-sidebar')) { ?>
	<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4  <?php if( $default_sidebar != 0 ){ echo ' homey_sticky'; } ?>">
		<div class="sidebar">
			<?php get_sidebar(); ?>
		</div>
	</div>
<?php } ?>

3. If you'd like to remove this sidebar only from the single post pages of specific post type(s), the steps would be the same as mentioned in option 2, but the only difference is that the file name that you'll place in the child theme folder should be named in "single-{post-type-slug}.php" format.

For example, to target single post pages of "Dining" post type, the file name would be "single-dining.php".
( ref: https://developer.wordpress.org/themes/basics/template-hierarchy/ )

4. If you're comfortable with PHP code customizations and would like to control the sidebar's display from the content template edit screen, you can also follow the steps explained in the guide that you referenced.
( https://toolset.com/documentation/beyond-pages-program/adding-custom-type-compatibility-to-your-theme/ )

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1675373
Screen Shot 2020-06-24 at 1.18.19 PM.png
Screen Shot 2020-06-24 at 1.16.47 PM.png

Ok, this is great! Thank you!

The theme options also allow for a full-width header to be placed on pages. I'd like to use this function for the custom post types / Content Templates.

How can I add this to the Content Template options?

#1675429
003 Custom Post Type Full Width.jpg
002 Custom Post Type Page Layout.jpg
001 Page with View.jpg

Another question. I'm thinking option 3 from your post would be the most beneficial.

But to make the page full width without the theme functions that's within the single.php, I'd also need to hide:

The breadcrumbs
The automated title
The meta data (thumbnail, author, date, etc.)
The author box at the bottom of the page (NOT PICTURED IN THE SCREENSHOTS)

What code should I remove from the single.php to hide those?

#1676753

Hi Cathryn,

Thanks for the update and glad that my message helped.

Unfortunately, the theme offers the header banner controls for the pages and posts, but not for the custom post types. This means you'll need to add a fair deal of code customizations, to make this work for the other post types.

You'll find the code for the other items like breadcrumbs, title, metadata, author box, etc, in the same "single.php" file, that I mentioned earlier. You'll just need to scan for the code before and after the line "<?php the_content(); ?>".
( this line is responsible for loading the assigned content template, so it is important that it is not removed )

As much as we would like to help, I'm afraid, 1-1 troubleshooting and customization assistance around the theme's code is something that is beyond the scope of the support that we can provide.
( ref: https://toolset.com/toolset-support-policy/ )

For questions related to the theme's code and templates, it would be best to consult the theme's official support, to get most accurate and up-to-date information.

Note: To get personalized assistance around the theme customization, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar