Displaying sidebar in x theme or pro for woocommerce single page

Hi,

Please make sure to add it after this line in your child theme’s functions.php file.

// Additional Functions
// =============================================================================

Thanks

1 Like

the functions.php in my child theme is completely empty.

By the way, why don’t you include a feature in the theme so we can just switch on product page sidebar in the customiser? With a drop down to select which sidebar globally and one in the product editor to override for a specific product.

Kind regards,
Edwin

Hi Edwin,

That’s right, it shouldn’t be empty. It should at least has this upper part

<?php

// =============================================================================
// FUNCTIONS.PHP
// -----------------------------------------------------------------------------
// Overwrite or add your own custom functions to Pro in this file.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Enqueue Parent Stylesheet
//   02. Additional Functions
// =============================================================================

// Enqueue Parent Stylesheet
// =============================================================================

add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );

Else, you’re simply adding a text content and not a code. Or please re-install you child theme, the one that came/downloaded from your Apex dashboard. Then add the recommended code at the end of that existing content of functions.php

That code is also part of the theme and you’re only overriding it with the provided custom one. It’s done like that since the layout is usually permanent, it’s going to be a bloated software if we’ll add a code that assigns layout for each page and post when you can override it just when needed. It’s a theme framework :slight_smile:.

And page templates contains more layouts that you could use without coding too, but yes, it can’t be applied to post and custom post type

Plus, this thread is also related to layout override and not just assigning a sidebar. If you’re only looking for assigning the sidebar then please go to Admin > Appearance > Sidebars and create your sidebar and assign it to your page, post, product, taxonomy, blog and so on.

But I agree, there should be more options for sidebars without a need for coding.

Thanks!

Thanks, that did the trick. Now is there any way to switch off the sidebar for specific products? There are a few products that I don’t want to have the sidebar. And also on mobile (screensize < x pixels) I wouldn’t want to have the sidebar.

Another problem, now there is room for the sidebar but the widgets I assigned to it are not shown at all :frowning:

Hi @edwinoonk,

Could you please create YOUR OWN TICKET then provide us with your website URL/admin account so we can take a closer look?

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.