WordPress.org

Ready to get started?Download WordPress

Forums

Widget CSS Classes
[resolved] Plugin not working for me :-( (3 posts)

  1. ppwd
    Member
    Posted 1 year ago #

    Perhaps I have misunderstood.

    I presume this is the relevant code in wp-includes/widgets.php?:

    function register_sidebar($args = array()) {
    	global $wp_registered_sidebars;
    
    	$i = count($wp_registered_sidebars) + 1;
    
    	$defaults = array(
    		'name' => sprintf(__('Sidebar %d'), $i ),
    		'id' => "sidebar-$i",
    		'description' => '',
    		'class' => '',
    		'before_widget' => '<li id="%1$s" class="widget %2$s">',
    		'after_widget' => "</li>\n",
    		'before_title' => '<h2 class="widgettitle">',
    		'after_title' => "</h2>\n",
    	);

    I have edited this to:

    function register_sidebar($args = array()) {
    	global $wp_registered_sidebars;
    
    	$i = count($wp_registered_sidebars) + 1;
    
    	$defaults = array(
    		'name' => sprintf(__('Sidebar %d'), $i ),
    		'id' => "sidebar-$i",
    		'description' => '',
    		'class' => '',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
                    'after_widget'  => '</div>',
    		'before_title' => '<h2 class="widgettitle">',
    		'after_title' => "</h2>\n",
    	);

    But I still cannot get the plugin to work.... Perhaps I have missed something very obvious!

    http://wordpress.org/extend/plugins/widget-css-classes/

  2. Cindy
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    The code that you need to edit if the plugin is not working is in your theme's functions.php, which will be located in /wp-content/themes/yourthemename/. It's possible though that your theme uses a non-standard method or location of registering sidebars. If you're using a free theme and can't find the location to edit, I can look at the code if you provide me with the theme URL.

  3. ppwd
    Member
    Posted 1 year ago #

    Hi Cindy,

    Thank you for your prompt response. After looking at another of your answers I had tried another theme and realised that was the problem....

    function register_sidebar does not appear in my functions.php

    I would prefer not to post url in public as is in development, but I will email, if that's okay

    Thanks again

    Nicola

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.