Custom sidebar problem

Hello there,

I have created a custom sidebar with the ID: ups-sidebar-download-maternity

Then I created a custom page template and added the ID here:

_get_view( x_get_stack(), 'template', 'ups-sidebar-download-maternity' );

But it breaks the page and shows nothing - what is the correct way of doing this with Pro?

Kind regards,

Spencer

Hi,

I should add that I have called the new template: template-download-sidebar.php

In the default theme templates the latter portion of the template name is used in the _get_view( x_get_stack() , so I know I am getting this wrong. How do I pull a custom sidebar into a custom template?

Cheers,

Spencer

Hi Spencer,

Thank you for writing in, are you trying to assign a custom sidebar to a specific page? You can do that on the sidebar panel.

If you prefer to continue using your custom template use the dynamic_sidebar( ); function to output your custom sidebar.

Function Reference/dynamic sidebar

wrap it in <aside class="x-sidebar right"> so it does stay on the right side of the content.

e.g.

<aside class="x-sidebar right">
    <?php if ( is_active_sidebar( 'ups-sidebar-my-custom-sidebar' ) ) : ?>
			<?php dynamic_sidebar( 'ups-sidebar-my-custom-sidebar' ); ?>
	<?php endif; ?>
</aside>

Please do note that this is customization and we cannot provide further support for this.

Hope it helps,
Cheers!

@friech

Thanks for getting back to me.

Cheers for the pointer - I didn’t realise this sidebar method was still available in WP5 still, so I figured out from there.

Thanks for your help :slight_smile:

Spencer

You’re always welcome Spencer!

Cheers.

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