• Resolved jbbrwcky

    (@jbbrwcky)


    Hi,

    After designing a theme I want to convert a horizontal content block to be widgetised. I then realised there is an issue – how do I limit the amount of widgets that someone can use/add? Also, how do I put in defaults if the blog owner doesn’t select them, or if they only select say, two instead of three?

    Richard

Viewing 2 replies - 1 through 2 (of 2 total)
  • how do I limit the amount of widgets that someone can use/add?

    Ultimately, you can’t. That’s for the user to decide. The best you can do is to try and ensure that the horizontal block wraps over multiple lines. So – ok – it might look awful but if all of the text/links are readable and accessible, then I’d argue that, as a designer, you’ve done all you can do. At the end of the day, you cannot idiot-proof a theme.

    how do I put in defaults if the blog owner doesn’t select them

    Place default content in there – e.g,:

    <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Top Tabs') ) : ?>
    
    <?php wp_page_menu('show_home=1&menu_class=default-menu');?>
    
    <?php endif; ?>

    or if they only select say, two instead of three

    Widget default behaviour is to replace all default content as soon as a single widget is added. So if your design holds up with a single widget in place, again, you’ve done all you can do.

    Thread Starter jbbrwcky

    (@jbbrwcky)

    Hey Esmi,

    Yeah I thought that might be the case. Thanks though!

    Richard

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limit widgets to a number’ is closed to new replies.