WordPress.org

Ready to get started?Download WordPress

Forums

Html coding in sidebar...banners, topsites (7 posts)

  1. HollyM
    Member
    Posted 8 years ago #

    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 blogpatrol.com 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!

  2. Austin Matzko
    Member
    Posted 8 years ago #

    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.

  3. HollyM
    Member
    Posted 8 years ago #

    Sure, my url is:

    http://www.hollymccaigdesigns.com/blog

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

    http://blog.geminigeek.com/wordpress-theme

    Thanks.

  4. HollyM
    Member
    Posted 8 years ago #

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

  5. Austin Matzko
    Member
    Posted 8 years ago #

    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:

    ...
    </ul>
    </li>

    <?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(); ?>
    ...

  6. HollyM
    Member
    Posted 8 years ago #

    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();
    p='http';
    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="http://www.blogpatrol.com/counter.php?i=36676' + data + '">');
    document.write('
    ');
    </script>

  7. HollyM
    Member
    Posted 8 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic