Widget for adding stuff after all excerpts at homepage

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2754 Reply

    Anonymous

    Hello…

    I would like to know if there is a way/widget to add something after all the excerpts are over… at the homepage… thanks!

    #2755

    Anonymous

    Apart from the footer.

    #2756

    Ron
    Keymaster

    It’s possible to do that but you’d have to follow a few steps.
    also it is important that you are using a child theme!

    1. Go to Dashboard -> Appearance -> Editor -> Select Theme to edit.

    2. Replace the contents of the PARENT Asteroid Theme’s index.php with this http://pastebin.com/raw.php?i=33LGFEwY then save. (No need to do this step if using Asteroid Theme 1.1.0 or later.)

    3. Add this code on the CHILD Asteroid Theme’s functions.php

    function register_extra_sidebar() {
    	register_sidebar(array(
    		'name' 		=> __('After Content', 'asteroid'),
    		'id' 		=> 'widgets_after_content',
    		'before_widget' => '<div id="%1$s" class="widget-after-content %2$s">',
    		'after_widget' 	=> '</div>',
    		'before_title' 	=> '<h4 class="widget-title">',
    		'after_title' 	=> '</h4>',) 
    	);
    }
    add_action('after_setup_theme', 'register_extra_sidebar');
    
    function widget_after_content() {
      if ( is_home() ){
    	echo '<div id="widgets-wrap-after-content">';
    	  dynamic_sidebar( 'widgets_after_content' ); 
    	echo '</div>';
      }
    }
    add_action('ast_hook_after_content', 'widget_after_content');

    Now when you go to the widgets page there will be a new area called “After Content”.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Widget for adding stuff after all excerpts at homepage
Your information: