Skip Navigation

[Resolved] Sidebars for custom CPT not displaying

This support ticket is created 3 years, 2 months 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Shane 3 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#2163591

The sidebars an widgets as per below link is not displaying on my CPT (George Documents) single and terms pages. How can I go about it displaying?
hidden link

I can provide login details to get access to the website as it is on a staging site.

#2163841

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-09-08 at 2.56.20 PM.png

Hi Fleur,

Thank you for getting in touch.

I've looked at this page for you and I see that the sidebars are being displayed. See Screenshot

Currently i'm not seeing any issues unless i'm looking in the wrong place.

Thanks,
Shane

#2164171

The link provided was only example of what it should look like. The CPT is not showing the same. I will need tp provide login details in order to for you to view the below page:

hidden link

#2164587

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Fleur,

I've enabled the private fields for your next response so that you can send me the credentials.

Thanks,
Shane

#2164593

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Fleur,

Thank you for the link.

The issue here is being caused by your theme. It would appear that your theme doesn't allow for you to define the template layout for custom post types.

The best advice that I can give here is for you to get in touch with the theme author for them to see if it is possible to allow for your custom post types to the sidebars.

Generally these areas are controlled by your theme.

Thanks,
Shane

#2164595

See reply from Theme Devs:

Unfortunately, that is not possible without he custom coding as this is a 3rd party custom post type archive.

You can take a look for example into inc/lsvr-directory/actions.php lines 254 to 292 to see how the code looks for the built-in Directory Listing post type.
Copy those lines of code to your child theme's funcitons.php, change the name of functions (just prefix them with something unique), change the “lsvr_listing” to the system name of your own document post type and then assign the IDs for left and right sidebars to $sidebar_id variable.

The custom sidebar ID will look like "lsvr-townpress-custom-sidebar-X” where X is its number, which you will get when you to to Appearance / Customize / Custom Sidebars and hover over the “X” button (ignore the # sign), so it will look like "lsvr-townpress-custom-sidebar-1” for example.

So to put it in the context of the code, instead of this:

$sidebar_id = get_theme_mod( 'lsvr_listing_single_sidebar_left_id', 'lsvr-townpress-default-sidebar-left' );

you will have this:

$sidebar_id = “ townpress-custom-sidebar-1";

#2164671

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Fleur,

I'm not sure I understand exactly how to handle this.

They provided a solution however the instructions on how to implement it aren't clear. They need to provide a clear step by step solution on how to implement this for a custom post type.

Currently the instruction is quite vague making it difficult to provide a solution. Are they not able to just give you the code that would resolve this ?

Thanks,
Shane