How To Change "class" of widgets!!
-
Hey everyone i need to edit my side bar’s widget’s class so i can style them different from others. http://moms-couponmatic.com/
i know the widgets ids and classes. but cant locate them in ftp. i have already checked wp-includes/widgets or wp-admin/widgets.php.
-
Stay out of the wp-admin & wp-includes folders and all WordPress core files. As you are using a non-WPORG theme, you need to seek support from the theme’s developers – paid or otherwise. We only support themes downloaded from wordpress.org here.
Try http://ithemes.comAnd bear in mind that you may need to create a child theme for your changes.
Thank you for the replay. I don’t think they will give any support. Yeah i have made changes a lot on this theme. I am sure there will be no theme update in the future and since i didn’t touch wp-admin & wp-includes folders, i don’t think i will have any problems on wordpress updates.
Do you agree?
and where do they usually locate those “widget’s class” stuffs on WPORG themes?
Take a look at your themes stylesheet.
It may be in a location similar to this:
wp-content/themes/yourthemefolder/style.css
Also see this screenshot for the CSS styles that are currently being used on your sidebar widgets (bottom right):
to change the widget class you need to go functions.php of your activated theme and find the code which says sidebar, register related. or try to search with the name of widget class.
you may see <div class=”widget title”>…,
then change the class name whatever you want…
to explain bit further i can show following code which is used to display sidebar.
<?php $args = array( 'name' => __( 'Sidebar name', 'theme_text_domain' ), 'id' => 'unique-sidebar-id', 'description' => '', 'class' => '', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>' ); ?>
now see class=”widget part in above code. now change the widget to something meaningful and use this classs to style in css.
hope it helps.
Thank you for help zakir. This is all i have in my functions.php of currently activated theme
<?php if ( function_exists('register_sidebars') ) register_sidebars(2); add_theme_support( 'post-thumbnails' ); ?>
I think, i need to add some code myself. I am sure the theme i am using doesnt have those codes you just wrote
can you please mention the theme u using?
You using theme from http://ithemes.com ?
In that case that theme used somewhere else the above code, not in functions.php as you mentioned.
Try to look at other folders in your theme.
Yes i am. it might be. i have checked all files through, but couldnt find it. (anyway there is only 10 files under theme folder.
also checked r_sidebar.php and found nothing. do you think they would keep those codes somewhere else and not under active theme folder?
Are you using child theme?
I need to download the theme and take a look.
Hang onoh it is not free !!
in that case I think you need to ask help from ithemes.
i am not using child theme and it’s free. here it is
[Link removed]I’m sorry but as you are using a non-WPORG theme, you need to seek support from the theme’s developers – paid or otherwise. We only support themes downloaded from wordpress.org here.
- The topic ‘How To Change "class" of widgets!!’ is closed to new replies.