This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

sidebar divider

  • Creator
    Topic
  • #9245
    michell610
    Participant

    I am trying to add a div to the right sidebar so I can add and style a vertical divider that will be responsive. I have tried this, which doesn’t work:

    function themeblvd_fixed_sidebar_before_default( $side ){?>
    		<div class="sidebardivider">
    			<div class="right-sidebar-divider"> 
    			<?php
    }
    function themeblvd_fixed_sidebar_after_default( $side ){?>
    			</div>
    		</div>
    		<?php
    }

    Any suggestions?
    Thanks in advance,
    Michell

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #9251
    Jason Bobich
    Keymaster

    Hello Michell,

    So, essentially you’re just trying to get some HTML markup before and after the sidebar, right? This would be a great chance to utilize some action hooks.

    http://dev.themeblvd.com/tutorial/actions/

    http://dev.themeblvd.com/tutorial/primary-framework-action-hooks/

    Here’s a basic example of how you can get started from your Child theme’s functions.php, if I understand what you’re trying to accomplish.

    /**
     * Add content before fixed sidebars.
     */
    function my_fixed_sidebar_before(){
    	?>
    	<div class="sidebardivider">
    		<div class="right-sidebar-divider"> 
    	<?php
    }
    add_action( 'themeblvd_fixed_sidebar_before' , 'my_fixed_sidebar_before', 9 );
    
    /**
     * Add content after fixed sidebars.
     */
    function my_fixed_sidebar_after(){
    	?>
    		</div><!-- .sidebardivider (end) -->
    	</div><!-- .right-sidebar-divider (end) -->
    	<?php
    }
    add_action( 'themeblvd_fixed_sidebar_after' , 'my_fixed_sidebar_after', 11 );

    The above is going to wrap what’s currently in Jump Start, and if you wanted to actually remove what is currently there by default, you can add this into the mix:

    remove_action( 'themeblvd_fixed_sidebar_before', 'themeblvd_fixed_sidebar_before_default' );
    remove_action( 'themeblvd_fixed_sidebar_after', 'themeblvd_fixed_sidebar_after_default' );
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.