• Resolved chickendipper

    (@chickendipper)


    Hello,

    Do you have any code I can use to insert add to any directly into a template file?

    I am using a plugin and would like to show the buttons on a page related to the plugin, but in order to do so I have to add directly to the template.

    Eg: <?php echo [addtoany] ?>

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author micropat

    (@micropat)

    Hello,

    See the plugin’s FAQ for PHP template code snippets.

    Thread Starter chickendipper

    (@chickendipper)

    Hi,

    Thanks I missed that.

    Is it possible to make the buttons load in an page that has been loaded with ajax?

    The buttons show if I refresh the page in the browser, but not on the initial visit which I think will be due to the ajax load.

    Thanks

    Plugin Author micropat

    (@micropat)

    Covered in this FAQ:

    jQuery( 'body' ).trigger( 'post-load' );

    Thread Starter chickendipper

    (@chickendipper)

    Hi,

    Thanks for the reply.

    I am not very good with JS, I have tried using this but it isn’t working.

    I use this code that I found to make the a3 lazy load plugin work:
    setTimeout(function() { jQuery(window).lazyLoadXT(); }, 1 ); }); })(jQuery);

    Could you kindly format the jquery for addtoany to match the above?

    I am fairly sure my jquery for a3 lazy load doesn’t need a timeout either, just not sure on how to remove that but it works so you could still use this for the addtoany.

    Thank you.

    Thread Starter chickendipper

    (@chickendipper)

    Apologies the code above is not complete I did not copy the entire snippet.

    Here is the code:

    (function($) { $(document).on('pjax:complete', function() { 
    setTimeout(function() { jQuery(window).lazyLoadXT(); }, 1 ); }); })(jQuery);
    • This reply was modified 2 years, 9 months ago by chickendipper.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Insert directly into theme’ is closed to new replies.