NVM – I think I may have solved this on my own. Sorry about that!
Plugin Author
nK
(@nko)
Hi Caitlin.
I’m glad that you resolved this, but I think this may be helpful for other users. Soon plugin will be updated and added a new FAQ section. There will be a list of some available jQuery methods. So, you can destroy and initialize portfolio after your AJAX page loaded.
Example:
// Initialize.
$( '.vp-portfolio' ).vpf();
// Destroy.
$( '.vp-portfolio' ).vpf( 'destroy' );
Regards, nK.
Thank you!!! This is great!!!
Hey @nko – I am still having some trouble with this. Can I please ask to employ your help, formally? Thank you – C
Plugin Author
nK
(@nko)
Hi @yelloworange.
I found some bugs with custom jQuery Events triggering, fixed in 1.7.2.
If you tried to use it and no success, please, try again with the new version.
We are not doing custom work, so, I’m not sure I will help with custom code. I only may help if there is a bug in the plugin code.
Hey nK – I hope this finds you well.
I think i may have figured out (a friend helped quite a bit with this effort) what is wrong but do not know how to fix it. When using ajax, the initialize and destroy methods seem to work – but if two portfolios are of different types (ie: masonry and tiles), the correct css files do not load along with the ajax calls. I believe this is the problem I am experiencing- which I think you would be able to confirm by visiting the site – caitlineverett.com.
Thank you
C
-
This reply was modified 7 years, 5 months ago by
yelloworange.
PSS: To confirm that this is the case, I made a test post here: http://caitlineverett.com/testpost/ – if you switch between the homepage and this page, the portfolios both work — so the issue is not that the jquery init/destroy methods do not work, but that switching between portfolio types does not seem to work (probably css related).
Plugin Author
nK
(@nko)
You also need to load new styles from on the new page.
For example on this page http://caitlineverett.com/blog/ portfolio adds styles:

And when you load the page using AJAX, you ignore these styles.
Hey nK! Thank you for looking. I am not sure what is the best way to accomplish this. Do you have any recommendations?
PS: was looking at this
if( ! jQuery('#visual-portfolio-items-style-fly-css').length ) // fly stylesheet
{
jQuery('head').append('<link rel="stylesheet" type="text/css" href="http://www.caitlineverett.com/wp-content/plugins/visual-portfolio/templates/items-list/items-style/fly/style.css">');
console.log("added fly stylesheet");
}
but it does not seem to work, exactly… id be happy to help with a plugin update if you have a strategy that you think would work best
PSS: Enqueing them permanently works!! This is great news!! I wonder if there is a way to enqueue and de-queue w/ajax or the likes. Sorry to send you so many of these and thank you!