![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jul 2005
Posts: 2,339
|
WordPress Gurus...I need a little help please...
First off, just wanna say long time no talk. I've been dropping in from time to time over the past year, but never really had anything to contribute, so I just hung out and tried to catch up on what was going on. Was sad to see that some (most) of the old posters on here are gone, but I guess that's just the way life is. Still sort of sucks though.
Anyway, I have a small problem I can't work out. I say small because I know one of you can fix it in 5 minutes, whereas I've been up all night working on it. I'll try to explain the best I can, but any of you that know me knows I'm not the best at that... I'm creating a site for one of my business partners and we're using a premium (i.e. bought) theme. The whole damn thing is widgetized, which was working out great until tonight when we wanted to make some changes to the widgets and found that we couldn't...or rather that we could, but it changed all the widgets and not just the ones we wanted to change. Basically we need 3 different sized widgets on the site, so what I did was copied one of the pre-existing widgets, changed the filename and the CSS on it, and reuploaded it, and it didn't work. We also tried just changing the CSS in the stylesheet, but that caused every widget on the site, no matter what type, to change as well. Here's where I think the problem lies, in the functions.php file... PHP Code:
So here's what I need to do, and I'm hoping someone here (Fris...you still around, man?) can help me figure out how to do it. I need to take this widget... PHP Code:
Thanks in advance! I greatly appreciate any help that anyone gives me. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jan 2013
Posts: 2,622
|
Just add 'exclusiveclassname' or what ever you want to call it.
<div class="widget-container exclusiveclassname"><div class="widget-inner"> then you can style just that widget with .widget-container.exclusiveclassname |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jul 2005
Posts: 2,339
|
Add it where, to the "before_widget" thing in functions.php? I tried that, and it applies it to every widget in that widget area.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Feb 2005
Posts: 1,699
|
The "register_sidebar" function creates a widget AREA. Once you've created a widget AREA then you can drop widgets onto it.
So what you need to do is to create the two different widget areas you need by adding this to your functions file (you could also use register_sidebars() but it's a bit easier to read them when they're separate): Code:
/* top categories */ if ( function_exists('register_sidebar') ) { register_sidebar( array( 'id' => 'top-featured-categories', 'name' => 'Top Featured Categories', 'before_widget' => '<div class="widget-container top-featured-categories"><div class="widget-inner">', 'after_widget' => '</div></div>', 'before_title' => '<h4 class="widget-header">', 'after_title' => '</h4>', )); } /* top categories */ /* regional categories */ if ( function_exists('register_sidebar') ) { register_sidebar( array( 'id' => 'regional-categories' 'name' => 'Regional Categories', 'before_widget' => '<div class="widget-container regional-categories"><div class="widget-inner">', 'after_widget' => '</div></div>', 'before_title' => '<h4 class="widget-header">', 'after_title' => '</h4>', )); } /* regional categories */ Code:
/* show top featured categories widget */ if( function_exists( 'dynamic_sidebar' ) ) { dynamic_sidebar( 'top-featured-categories' ); } /* show top featured categories widget */ /* show regional categories widget */ if( function_exists( 'dynamic_sidebar' ) ) { dynamic_sidebar( 'regional-categories' ); } /* show regional categories widget */ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Join Date: Jul 2005
Posts: 2,339
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: May 2012
Posts: 124
|
you should style by id as id is for unique identifier and each one should have their own id
I thought widgets always generated their own id's, but if your widgets don't have specific id's this url might be of use to you specifically this: <?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>' ); ?> %1$s should give unique id per widget source url: http://wordpress.org/support/topic/h...ids-or-classes |
![]() |
![]() ![]() ![]() ![]() ![]() |