injecting my wordpress header/footer in to amember templates

Discussion in 'Customization & add-ons' started by gordyr, Jun 20, 2011.

  1. gordyr

    gordyr New Member

    Joined:
    Jun 20, 2011
    Messages:
    4
    Hey all,

    I have successfully edited all my templates so that they look exactly the same as my wordpress site.

    However I use a sliding panel plugin with the amember login widget inside on my wordpress site which I would still like to be visible on the amember sign up, member page etc...etc...

    Now i tried to use:

    require('../wp-load.php');

    and used a get header/footer command.

    in the member.php file etc... which worked (although it spilled out a header already sent error)

    Really... The question is, what php file should I put the above code into to load my wordpress header and footer dynamically which will in turn load my wordpress sliding panel.

    I though about trying to execute the php commands from within the layout.html file, which i believe is possible with some .htaccess tweaks, but I couldn't get it to work.

    I hope that makes some sense!

    Any ideas?
  2. gordyr

    gordyr New Member

    Joined:
    Jun 20, 2011
    Messages:
    4
    Okay... I've actually solved this by injecting the code into my header.html and footer.html. Don't know why I didn't think of it earlier!! doh!

    However I now have a new problem. I am trying to load some javascript into my footer so i'm use the smarty {literal} and {/literal} tags. However it's throwing up an error saying that smarty cannot recognize the /literal tag. I thought this was standard in smarty code??

    Anyone?

    My footer.html looks like this...




    {literal}<script type="text/javascript">
    var $ = jQuery;
    $(document).ready(function(){
    $(".fadein").fadeTo("medium", 0.7); // This sets the opacity of the thumbs to fade down to 30% when the

    page loads
    $(".fadein").hover(function(){
    $(this).fadeTo("medium", 1.0); // This should set the opacity to 100% on hover
    },function(){
    $(this).fadeTo("medium", 0.7); // This should set the opacity back to 30% on mouseout
    });
    });
    </script>{/literal}

    </div>
    {php}get_footer();{/php}
    {php}
    echo amember_get_footer($this->_tpl_vars);
    {/php}


    Go easy on me i'm very new at anything other than basic html/css! :p
  3. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    @gordyr: what version of aMember are you using? You may want to consider modifying layout.html as opposed to the legacy header/footer templates.
  4. gordyr

    gordyr New Member

    Joined:
    Jun 20, 2011
    Messages:
    4
    i'm using the latest 3.2.3

    You're right it would be best... I'll make the adjustments...

    Any ideas how to get the javascript in though?
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    literal tags will be added automatically after <script type="text/javascript"> so you don't need to specify these tags in your code. You need to use them only if you need to use smarty variables inside javascript code
  6. gordyr

    gordyr New Member

    Joined:
    Jun 20, 2011
    Messages:
    4
    Thanks...

    without the literal tags I still recieve an error however.
  7. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Couple of suggestions:

    1) make sure your quotes are standard ascii quotes and not cut and pasted from a rich editor. (ie. “ = bad ... ." = good)

    2) remove your comments from your javascript (ie. // ..... )
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279

Share This Page