Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9032923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:05:56+00:00 2026-06-16T08:05:56+00:00

On my wordpress installation, I created a new theme for a new page template

  • 0

On my wordpress installation, I created a new theme for a new page template I created. However, when I goto create new widgets, each widget automatically gets the class of “textwidget”. I have two different styles I have for widgets that require different styles, so I’m not too sure how to give each indivudal widget a different class or to label them differently?

Anyone know how to do this?

Here’s a page from my site with the 2 widgets: http://www.simonsayswebsites.com/how-we-get-you-more-customers/

You can see each one is within a widget that has the same class name.

This is what I added to my page functions.php to add the widget:

    if ( function_exists('register_sidebar') ){
    register_sidebar(array(
        'name' => 'sidebarpage',
        'before_widget' => '<div id="sidebarpage">',
        'after_widget' => '</div>',
        'before_title' => '',
        'after_title' => '',
));
}

And here’s the snippet from the page template itself for it to display:

<?php /* Widgetized sidebar */
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebarpage') ) : ?><?php endif; ?>

I could make it using different widgetized areas, but want to learn about having individual widget styles.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:05:57+00:00Added an answer on June 16, 2026 at 8:05 am

    You are mistaking name and id.

    Also, in before_widget, you shouldn’t declare a fixed ID, in your site both Widgets have the same ID and that’s… no good.

    If you follow the example in the Codex, your widget will receive an unique ID and a relevant class.

    http://codex.wordpress.org/Function_Reference/register_sidebar

    Default usage

    <?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>' ); ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using these 2 plugins: HTML Page Sitemap http://wordpress.org/extend/plugins/html-sitemap/installation/ SyntaxHighlighter Evolved http://wordpress.org/extend/plugins/syntaxhighlighter/ When
I am having a CRAZY error with Wordpress. When I create a new article
Can I create a installation menu for a wordpress plugin? When I click on
I'm having a very basic problem: I'm trying to create a new theme for
Let's say I have a WordPress installation, with a page named About. If I
My website - http://www.myhomecare.ie - is a Wordpress Installation using the Sterling theme which
I moved a WordPress installation to a new folder on a Windows/ IIS server.
I have a wordpress installation with some plugins and a custom theme. On one
I changed the folder that my WordPress installation was in. However, this worked fine,
I have a wordpress installation I'd like to get rid off. It's been constant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.