• Resolved registerone

    (@registerone)


    Hello.

    I have the Sidebar on the left and I’d like bpress-nav-accordion to open automatically when you view the page.

    Is there a setting or js function I can add to WP to open it? It’s the bpress-nav-accordion.

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author BasePress

    (@codesavory)

    Hi @registerone,

    there is not an option to open the navigation on the main page.
    The navigation does open automatically once you click on the single section you have at the moment.
    Yet you can trigger a click on the navigation once the page is loaded using Javascript.
    The code to do that would be like this:

    add_action( 'wp_footer', function(){
    	?>
    	<script type="text/javascript" id="testing">
    		jQuery(document).ready( function($){
    			$( '.bpress-nav-section' ).first().click();
    		});
    	</script>
    	<?php
    }, 9999 );

    I hope this helps!

    Thread Starter registerone

    (@registerone)

    OK, yes, I could do a js click simulation. It would be handy to have that option built into the plugin at some point maybe. Thank you.

    Plugin Author BasePress

    (@codesavory)

    Hi,

    as you have a single section it might make sense to have that open directly.
    But when the entry page to the knowledge base has more sections and there are many articles it would not be optimal to have the whole menu opened automatically.
    For example like in our KB.
    I am open to new ideas though!

    Plugin Author BasePress

    (@codesavory)

    Hi,

    I just wanted to suggest another possible way to have the navigation open without using JS.
    You can use this code by adding it to your functions.php:
    https://gist.github.com/BrElio/3951370a548fd631c785a74ee1cb311a

    It might be a better alternative!

    Thread Starter registerone

    (@registerone)

    I agree, if they were all opened, it might not be the best, but maybe the first one as an option. I will try the filter you shared. Thank you!

    Plugin Author BasePress

    (@codesavory)

    Hi @registerone,

    I haven’t heard from you so I am closing this issue.
    If you still need help don’t hesitate to open a support ticket from the plugin’s menu.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Sidebar accordion auto-expand?’ is closed to new replies.