Support » Installing WordPress » Html coding in sidebar…banners, topsites

  • I’m not sure if this is the right spot, but hopefully someone can help me. I’m learning slowly here!

    In my blog, I want to include things like the html code for my account, and topsite images that have coding to include my site on a topsite listing via hits.

    How do I go about doing that? In Typepad, I just made a new typelist and put the code in the “notes” section and changed the configuration to show my notes as text. Then it automatically showed the results of my code.

    Thanks again!

Viewing 6 replies - 1 through 6 (of 6 total)
  • It depends on what theme you’re using. For example, many themes have a file called sidebar.php found in wp-content/themes/[name of the theme]/

    Using a text editor, you can add your code there and it could appear in the sidebar.

    If you provided more specific information, such as the name of your theme or your site’s URL, we might be able to provide more specific advice.

    Sure, my url is:

    I altered a theme with my header and colors, but liked styling and size of the one I downloaded – Cherry Berry, found here:


    oh – and i’m assuming this will work for any javascripting codes as well like some counter have.

    Cherry Berry theme has a sidebar.php file, so if you edit that, you can put the html/JavaScript wherever you want in there. Just make sure that it’s outside of the PHP tags (<?php . . . ?>). So, for example, to put your HTML below the archives in the sidebar, you might find this section of sidebar.php and insert your markup:


    <?php } ?>

    [Perhaps put your code here, instead of the brackets and included text]

    <?php /* If this is the frontpage */ if ( is_home() ) { ?>
    <?php get_links_list(); ?>

    Below is the code for my blog patrol counter…when I try to put that in, it messes things up and gives me errors. I’m not sure the javascripting is working too well…going to test an html code next.

    <script language=”javascript”>
    var data, p;
    var agt=navigator.userAgent.toLowerCase();
    if((location.href.substr(0,6)==’https:’)||(location.href.substr(0,6)==’HTTPS:’)) {p=’https’;}
    data = ‘&r=’ + escape(document.referrer) + ‘&n=’ + escape(navigator.userAgent) + ‘&p=’ + escape(navigator.userAgent) + ‘&g=’ + escape(document.location.href);
    if(navigator.userAgent.substring(0,1)>’3′) {data = data + ‘&sd=’ + screen.colorDepth + ‘&sw=’ + escape(screen.width+ ‘x’+screen.height)};document.write(‘‘);
    document.write(‘<img border=0 hspace=0 ‘+’vspace=0 src=”’ + data + ‘”>’);

    Okay, got an HTML and flash code to work (my flickr photos)…still having trouble with the javascripts working.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Html coding in sidebar…banners, topsites’ is closed to new replies.