Viewing 15 replies - 1 through 15 (of 32 total)
  • Evan Herman

    (@eherman24)

    You need to edit footer.php of your theme or child theme, and use the function the_widget(); , provided by wordpress to display it.

    Check the codes: http://codex.ww.wp.xz.cn/Function_Reference/the_widget for further instruction and examples.

    esmi

    (@esmi)

    What theme are you using? Where did you download it from?

    Thread Starter Christopher411

    (@christopher411)

    Custom Theme made by some guy in corporate a while ago and he didn’t finish what we wanted.

    Is that why it isn’t coming in? Not properly defined in the Theme?

    Evan Herman

    (@eherman24)

    Yes, it has not been rendered on the page.

    Thread Starter Christopher411

    (@christopher411)

    I added:
    <?php the_widget( ‘Footer_Widgets_Left’ ); ?>
    <?php the_widget( ‘Footer_Widgets_Middle’ ); ?>
    to the body of the footer and nothing happened.

    Evan Herman

    (@eherman24)

    Try:

    <?php dynamic_sidebar( 'Footer_Widgets_Left' ); ?>

    You can also test to see if the widget is active:

    if ( is_active_sidebar( 'Footer_Widgets_Left' ) ) {
    	echo 'The Footer Widgets Left Widget is active.';
    }

    Can we see the code you used to register the footer widgets left widget?

    Thread Starter Christopher411

    (@christopher411)

    I added this to themes:

    add_theme_support( 'post-thumbnails');
    if ( function_exists('register_sidebar') )
    register_sidebar(array(
    'name' => 'Footer Widgets Left',
    'before_widget' => '<li class="widget %2$s" id="%1$s">',
    'after_widget' => '</li>',
    'before_title' => '<h3>',
    'after_title' => '</h3>'
    ));
    
    if ( function_exists('register_sidebar') )
    register_sidebar(array(
    'name' => 'Footer Widgets Middle',
    'before_widget' => '<li class="widget %2$s" id="%1$s">',
    'after_widget' => '</li>',
    'before_title' => '<h3>',
    'after_title' => '</h3>'
    ));
    
    if ( function_exists('register_sidebar') )
    register_sidebar(array(
    'name' => 'Footer Widgets Right',
    'before_widget' => '<li class="widget %2$s" id="%1$s">',
    'after_widget' => '</li>',
    'before_title' => '<h3>',
    'after_title' => '</h3>'
    ));
    
    function my_widgetized_footer() { ?>
    <div id="footer-widget-block">
    	<div class="my-footer-one footer-widgets sidebar">
    		<ul class="sidebar_list">
    			<?php thesis_default_widget(3); ?>
    		</ul>
    	</div>
    
    	<div class="my-footer-two footer-widgets sidebar">
    		<ul class="sidebar_list">
    			<?php thesis_default_widget(4); ?>
    		</ul>
    	</div>
    
    	<div class="my-footer-three footer-widgets sidebar">
    		<ul class="sidebar_list">
    			<?php thesis_default_widget(5); ?>
    		</ul>
    	</div>
    </div>
    			<?php
    	}
    add_action('thesis_hook_footer','my_widgetized_footer','1');

    and this to the css:

    .custom #footer-widget-block { text-align:left; overflow:hidden; }
    .custom .footer-widgets { width:33%; float:left; }
    .custom .my-footer-one {}
    .custom .my-footer-two {}
    .custom .my-footer-three {}
    Evan Herman

    (@eherman24)

    Firstly, I should have asked before, are you using the thesis theme??

    Thread Starter Christopher411

    (@christopher411)

    no, like I said I am a novice and just tried grabbing code to accomplish what I needed. We already have the site up with the theme whoever started the site for us used.

    Is there some other way to accomplish it?

    Evan Herman

    (@eherman24)

    Oh, well than that’s most likely why this isnt working. The function you are using is hooking into thesis_hook_footer.

    add_action('thesis_hook_footer','my_widgetized_footer','1');

    Change that too ‘wp_footer’, which may help resolve the issue.

    Thread Starter Christopher411

    (@christopher411)

    I am learning the hard way that everything is built on what has come before so grabbing some snip-it doesn’t work so well… so without the theme and css and widget and plug in and whatever configuration it doesn’t work.

    What I want is to setup a footer similar to one at the bottom of this page.

    Evan Herman

    (@eherman24)

    Have you tried changing thesis_hook_footer to wp_footer?

    add_action('wp_footer','my_widgetized_footer');
    Thread Starter Christopher411

    (@christopher411)

    Now we are getting somewhere!…. I am getting an error

    Fatal error: Call to undefined function thesis_default_widget() in…..

    Evan Herman

    (@eherman24)

    Oh woops, didn’t see that framework specific function.

    As a test, do:

    function my_widgetized_footer() { ?>
    <div id="footer-widget-block">
    	<div class="my-footer-one footer-widgets sidebar">
    		<ul class="sidebar_list">
    			<?php dynamic_sidebar( 'Footer Widgets Left' ); ?>
    <strong>Test Sidebar Left</strong>
    </ul>
    	</div>
    
    	<div class="my-footer-two footer-widgets sidebar">
    		<ul class="sidebar_list">
    			<?php dynamic_sidebar( 'Footer Widgets Center' ); ?> <strong>Test Sidebar Center</strong>
    		</ul>
    	</div>
    
    	<div class="my-footer-three footer-widgets sidebar">
    		<ul class="sidebar_list">
    			<?php dynamic_sidebar( 'Footer Widgets Right' ); ?> <strong>Test Sidebar Right</strong>
    		</ul>
    	</div>
    </div>
    			<?php
    	}
    add_action('wp_footer','my_widgetized_footer');

    Thread Starter Christopher411

    (@christopher411)

Viewing 15 replies - 1 through 15 (of 32 total)

The topic ‘Help adding widget to footer’ is closed to new replies.