• Resolved Patrick64

    (@patrick64)


    Hi. I’m trying to target the twitter widget to apply some CSS styling but I can’t work out how. I tried this shortcode..

    [twitter-widget username=”MYUSER” title=”” items=”3″ before_widget=”<div class=’twitter-widget’>” after_widget=”</div>”]

    But it outputs the <div class=’twitter-widget’> with html encoded like this…

    <div class=’twitter-widget’>

    Any ideas how I can target the widget with CSS?

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Patrick64

    (@patrick64)

    Sigh, the forum has re-encoded the last line of code, instead of the angle brackets it should read a bit like this but without the spaces…

    & l t ; div class=’twitter-widget’ & g t ;

    Rootside

    (@rootside)

    Sounds like you pasted the shortcode into the ‘Visual’ view. Switch to the ‘Text’ view (the tab at the top right corner of the main content field of your page/post) and try again.

    Thread Starter Patrick64

    (@patrick64)

    Ah that was it. Unfortunately I’m using Advanced custom fields and expecting the client to enter the shortcode so it’s not going to be possible to add it in HTML. In the end I added a tickbox and this code in the template (in case its useful to anyone)..

    <?php if(get_field('show_twitter_feed')): ?>
    <div class="mod callout bkgd-blue twitter-widget ">
    	<h4>Latest Tweets</h4>
    <?php echo do_shortcode('[twitter-widget username="myuser" title=" " items="3" showintents="false" showfollow="false" hidefrom="true"]'); ?>
    </div>
    <?php endif; ?>

    Thanks for your help Rootside. You are awesome.

    Rootside

    (@rootside)

    No sweat. Interesting approach there, I’m making a note of it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘targeting widget with CSS’ is closed to new replies.