how to place code in wordpress

Discussion in 'HTML & Website Design' started by ericandcandi, Mar 8, 2007.

  1. #1
    looking to place code for some adds and affiliate stuff. do i just go to sidebar if i want it in the sidebar and place it anywhere in the edit sidebar editor? how do i specify if it will be placed on the top or in the middle or at the bottom?
     
    ericandcandi, Mar 8, 2007 IP
  2. cron0s_65

    cron0s_65 Peon

    Messages:
    61
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if you look at the sidebar.php youll see something like this

    id="boxNewArticle">

    there are a few of them and each one is the code to the diffrent widgets in your sidebar they end with something like this

    </div><!--boxNewArticle end-->

    you can place your code in the middle of those depending on where you want it

    kinda new at this but i did that and it worked for me took me forever to figure it out lol
     
    cron0s_65, Mar 8, 2007 IP
  3. ericandcandi

    ericandcandi Peon

    Messages:
    171
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, but I guess my theme does'nt have this. searched everywhere. also please define widget. I feel like a total noob, but I guess thats what this forum is all about, right?
     
    ericandcandi, Mar 8, 2007 IP
  4. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #4
    WordPress contains a built in editor that allows you to edit theme files directly from within your browser. It is called the Theme Editor.

    Access the Theme Editor from the Administration > Presentation > Theme Editor Panel.

    To view a file in the Theme Editor, click on the file from the list.
     
    Richie_Ni, Mar 8, 2007 IP
  5. ericandcandi

    ericandcandi Peon

    Messages:
    171
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks Richie Ni, I know how to get to the editor, I was wondering about placing code for advertising boxes or small banners. I know I cannot place that code just anywhere, and I worry about broken code.
     
    ericandcandi, Mar 9, 2007 IP
  6. Blame Me

    Blame Me Guest

    Messages:
    162
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #6

    It would depend what theme you are using I should guess, I use a default "Classic" theme for one of my blogs and the code is something like this:

    My sidebar has a category list, then search box, then archives, then blogroll, then meta info and finally an image link.

    Once the blog gets up and running fully I should be adding and adsense block to the side bar just below the search box.

    The bits in bold are where my add-to is and where I plan to add adsense code.

    Your sidebar should look similar to this.

    I hope this helps in some way.

    :)
     
    Blame Me, Mar 9, 2007 IP
  7. ma0

    ma0 Peon

    Messages:
    218
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Why not try to add Widget support?
    http://automattic.com/code/widgets/

    It's not that difficult to create widget then. There is a simple example with the standard installation. I created one myself for my small project. I can show you it if you wish.
     
    ma0, Mar 10, 2007 IP
  8. Blame Me

    Blame Me Guest

    Messages:
    162
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #8
    That's a very nice tool :D

    Great for those that don't have a clue about html or to afraid to mess with all the code in th esidebar.

    Some of the Wordpress plug-ins are amazing.

    Thanks for sharing :)
     
    Blame Me, Mar 10, 2007 IP
  9. ericandcandi

    ericandcandi Peon

    Messages:
    171
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Hey, thanks for all of the great advice.
     
    ericandcandi, Mar 10, 2007 IP