WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Widget Free Sidebar (3 posts)

  1. dequecolour
    Member
    Posted 9 months ago #

    The site I am working on is here: internalcompass.us/castle

    You'll see I have a sidebar that is somewhat designed (at least in terms of the graphic layout I'm going to want.) At this point, I have it set up as one single image so I can just see how it looks, and nothing is linked.

    I have a widget at the top of the sidebar because otherwise the sidebar doesn't display at all. Frankly, I don't want any widgets. I just want to design myself a sidebar.php file. Is there a way I can manipulate the code for twentytwelve so it doesn't remove the sidebar if there are no widgets? Right now, it removes the sidebar if there are no widgets, so I am putting one there just to get it to show up.

    Here's the code I have in sidebar.php in the child theme fyi. gracias

    <?php
    /**
     * The sidebar containing the main widget area.
     *
     * If no active widgets in sidebar, let's hide it completely.
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    ?>
    	<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    		<div id="secondary" class="widget-area" role="complementary">
    			<?php dynamic_sidebar( 'sidebar-1' ); ?>
    		</div><!-- #secondary -->
    	<?php endif; ?>
    
        <a href=""> <img align="right" alt="sig" border="0" src="http://internalcompass.us/castle/wp-content/uploads/2013/07/sidebar.jpg" /></a></
  2. paulwpxp
    Font hero
    Posted 9 months ago #

    What you really want to do is drag a Text Widget into that sidebar area, give it no title, and then put that linked <img> tag into it. No need to modify anything in the template.

  3. dequecolour
    Member
    Posted 9 months ago #

    well, would ya lookie there. gracias, amigo.

Reply

You must log in to post.

About this Topic