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.

Reply To: Add Widget Area After Posts

#3313
Jason Bobich
Keymaster

Yeah, it looks like you’re getting a few things mixed up. In your call to add_action, you’re declaring your callback function as “display_after_post_widget”, which doesn’t exist; so it makes sense this would be outputting some kind of error like “Invalid callback …”

I think this is more what you’re going for:

// Create the widget area location
themeblvd_add_sidebar_location( 'after_post_widget', 'After Post Widget', 'collapsible' );

// Display it
function display_jumpstart_after_post_content() {
    themeblvd_display_sidebar( 'after_post_widget' );
}
add_action( 'themeblvd_single_footer', 'display_jumpstart_after_post_content' );

And just as a little bit better practice, it’s better to name your functions prefixed with something unique to you or your Child theme like this:

// Create the widget area location
themeblvd_add_sidebar_location( 'after_post_widget', 'After Post Widget', 'collapsible' );

// Display it
function herb_display_after_post_content() {
    themeblvd_display_sidebar( 'after_post_widget' );
}
add_action( 'themeblvd_single_footer', 'herb_display_after_post_content' );