WordPress.org

Ready to get started?Download WordPress

Forums

dynamic_sidebar not returning/echoing/printing HTML, need help... (3 posts)

  1. Spencer Hill
    Member
    Posted 1 year ago #

    Can anyone explain why these code snippets wouldn't echo/print/return this function with the li tags? In fact, nothing I try to execute (except for the function) prints out!

    if ( !dynamic_sidebar( 'right_column_on_two_column_layout' ) ) {
    	return "<li>" . dynamic_sidebar( 'right_column_on_two_column_layout' ) . "</li>";
    }
    if ( !dynamic_sidebar( 'right_column_on_two_column_layout' ) ) {
    	echo "<li>" . dynamic_sidebar( 'right_column_on_two_column_layout' ) . "</li>";
    }
    if ( !dynamic_sidebar( 'right_column_on_two_column_layout' ) ) {
    	echo "<li>";
    	dynamic_sidebar( 'right_column_on_two_column_layout' );
    	echo "</li>";
    }
  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    what are you trying to achieve?

    if you want to output the li tags conditionally, you might need to use a conditional with http://codex.wordpress.org/Function_Reference/is_active_sidebar

    http://codex.wordpress.org/Function_Reference/dynamic_sidebar#Examples

  3. Spencer Hill
    Member
    Posted 1 year ago #

    Thanks for taking the time to respond. I'm simply trying to wrap the sidebar in those li tags. But they're blatantly ignored. They don't appear in the executed code at all and I don't understand why.

    I tried is_active_sidebar and got the same results earlier today.

    [bump moderated]

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.