WordPress.org

Forums

Twitter Widget Pro
[resolved] Css Classes not applying. (5 posts)

  1. Roggers
    Member
    Posted 2 years ago #

    Hey guys. SO basically, I'm trying to style TWP with the same selectors used in the faq.
    However, none of the styles are applying. I looked in firebug and it seems no such class

    .widget_twitter
    exists in the html.

    How can I fix this?

    Thanks

    http://wordpress.org/extend/plugins/twitter-widget-pro/

  2. Aaron D. Campbell
    Member
    Plugin Author

    Posted 2 years ago #

    Probably means your theme doesn't declare it's sidebars properly. Can you link to your site as well as your theme?

  3. Roggers
    Member
    Posted 2 years ago #

    http://alexrodrigues.co.uk/ it's my custom theme
    Here is the code for sidebar deceleration in functions.php

    if ( function_exists( 'register_sidebar' ) ) {
    register_sidebar( array (
    'name' => __( 'Primary Sidebar', 'primary-sidebar' ),
    'id' => 'primary-widget-area',
    'description' => __( 'The primary widget area', 'dir' ),
    'before_widget' => '<div class="col2 widget">',
    'after_widget' => "</div>",
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );
  4. Aaron D. Campbell
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks. The before_widget part should have an id of %1$s (to be replaced with the id of the widget) and a class of %2$s to be replaced with the class for the widget (in this case widget_twitter). So try something like this:

    register_sidebar( array (
    	'name' => __( 'Primary Sidebar', 'primary-sidebar' ),
    	'id' => 'primary-widget-area',
    	'description' => __( 'The primary widget area', 'dir' ),
    	'before_widget' => '<div id="%1$s" class="col2 widget %2$s">',
    	'after_widget' => "</div>",
    	'before_title' => '<h3 class="widget-title">',
    	'after_title' => '</h3>',
    ) );
  5. Roggers
    Member
    Posted 2 years ago #

    Thanks, it worked! I'll be sure to use this method when declaring sidebars.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Twitter Widget Pro
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic