1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Loading content after

Discussion in 'WordPress' started by DOAD, Apr 7, 2010.

  1. #1
    I have a small script running in the <?php while (have_posts()) : the_post(); ?> loop which is similar to adsence and loads on each post, its really slowing my sites load time.

    Is there anyway to load the script at the end rather then during?
     
    DOAD, Apr 7, 2010 IP
  2. shivam0000

    shivam0000 Member

    Messages:
    178
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    33
    #2
    tRY PUTTING IN OTHER PLACE

    for eg . if it is in header change its place to footer

    :D
     
    shivam0000, Apr 7, 2010 IP
  3. DOAD

    DOAD Peon

    Messages:
    136
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Tried but it still loads as slow as it did before...
    btw the script is tweetmeme that uses custom fields to pull another sites url
     
    DOAD, Apr 7, 2010 IP
  4. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #4
    Deactivate the plug in and see if your load time increases. If not. It's not the plug in, you may have destroyed some code or left out a simple closing tag while you were making file edits.

    If it does load faster without the plug in activated, then you need to thing about not using it, using something else, or check into a cache plug in to help your site load faster.

    From what you have written, it seems that you are saying that you have put the code inside of the loop? <?php while (have_posts()) : the_post(); ?> If that is correct, that is probably the main culprit as I am sure that this is causing some confusion in your code. I am pretty sure that you SHOULD NOT add any code or scripts within that string.
     
    hmansfield, Apr 7, 2010 IP
  5. lukeg32

    lukeg32 Peon

    Messages:
    645
    Likes Received:
    19
    Best Answers:
    1
    Trophy Points:
    0
    #5
    If you load your script in the while loop it will run for each post returned..... If you want to do it afterwards but still on the same page then do it after the endwhile line.
     
    lukeg32, Apr 7, 2010 IP