Load plugin before the page is generated

Discussion in 'WordPress' started by danramosd, Dec 14, 2010.

  1. #1
    I am using the wp e-commerce plugin and wanted to display some information in the header of the website (display number of items in the cart). The problem is that I can only display it in the main content area or lower on the page. I'm assuming the plugin isn't loading until later in the page. Is there a way to run this plugin before the page is generated? I believe i might need a hook, but im not too familiar with them.
     
    danramosd, Dec 14, 2010 IP
  2. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #2
    When downloading a website it is like this (I hope I am right):

    1. load HTML-File
    2. load CSS files (in head)
    3. load JS files (if in head)
    4. load graphics addressed in HTML
    5. load graphics addressed in CSS files
    6. JS files (at bottom)

    The rendering of the website is (AFAIK) between 3 and 4.

    JavaScript is getting executed after 6, if I am correct. I think your plugin needs JavaScript, no?
     
    CSM, Dec 14, 2010 IP
  3. wpfan

    wpfan Member

    Messages:
    64
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #3
    Your best bet would be to ask over at the wp-commerce forum or search there forum for the answer as it may have already been asked.
     
    wpfan, Dec 14, 2010 IP