kgstwo
Forum Replies Created
-
I’ve gotten the plugin to a point where the sidebar is showing, but the Custom Sidebars aren’t replacing the proper widgets on their respective pages/posts. On each page the header/footer files don’t get loaded, is there a function that I can call to reinit the custom sidebar once the page is pjax loaded?
Any help with this?
Forum: Plugins
In reply to: [WP Job Manager] Using Job Manager plugin within pjax environmentThanks Mike,
I believe you’re right. Comparing the header on the live site (non-pjax) and the dev site (pjax), I believe I can see that the (document).ready isn’t being loaded. Attached two screenshot of the ajax-filters header on both sites:
non-PJAX: https://www.dropbox.com/s/d9yfcthcsoj22pv/WP-Job%20Manager%20non-PJAX%20load.png?dl=0
PJAX: https://www.dropbox.com/s/1ztlvreo8dkra6f/WP-Job%20Manager%20on%20PJAX%20load.png?dl=0
What can I do to get the document ready event to fire on the PJAX load?
Forum: Plugins
In reply to: [WP Job Manager] Using Job Manager plugin within pjax environmentThanks Mike,
Yes I have a sandbox with pjax functionality and a live site without that I’m comparing with. Yes I’m aware of the pjax:end event that allows code to run after loading. This is where I have the code of your screenshot now, but still some things not showing.
These two items in particular (comparing with my live site), have no elements in them at all when inspecting the code in my browser.
The “showing_jobs” div and
The “job_listings” ulEverything else appears to be as it should. Are these two the only elements where ajax loads the content? Anything I can do to get the child elements of these two to render?
Forum: Plugins
In reply to: [WP Job Manager] Using Job Manager plugin within pjax environmentsorry — or some css line I can call post-pjax load?
Forum: Plugins
In reply to: [WP Job Manager] Using Job Manager plugin within pjax environmentThanks Mike,
I think you were right, I don’t believe the the script after done() was running. I went ahead and put that script into a different function, no luck still.
One thing I’ve noted — on a pjax load, when I enter the script directly into my browser console, the “showing job” div doesn’t appear with any of the elements inside of it. And the “wp-job-manager-showing-all” class also associated with that div is not showing either (I noticed this class showing on a non-pjax load). Also the “job_listings” div which wraps the whole thing looks to be missing as well.
I have a feeling these are where the issue lies — is there any other js or css I’m not calling? Or
Forum: Plugins
In reply to: [WP Job Manager] Using Job Manager plugin within pjax environmentThanks, I removed that part. Still only seeing the loading gif initially. Subsequent pjax loads of the page don’t show anything at all. All the scripts appear to be loading, as well as the portion in the screenshot, anything else I can try?
Forum: Plugins
In reply to: [WP Job Manager] Using Job Manager plugin within pjax environmentNo errors, I added what was in the screenshot, my code looks like this now:
function jobs() {
$.when(
$.getScript( “/wp-content/plugins/wp-job-manager-applications/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager-career-builder-integration/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/js/jquery-chosen/chosen.jquery.min.js” ),
$.getScript( “/wp-content/plugins/wp-job-manager-indeed-integration/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager-resumes/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/js/ajax-filters.min.js” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/css/chosen.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/images/ajax-loader.gif” ),
$.getScript( “/wp-content/plugins/wp-job-manager-indeed-integration/assets/images/jobsearch.gif” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/images/company.png” ),
$.Deferred(function( deferred ){
$( deferred.resolve );
})
).done(function(){
$(window).on( “load”, function( event ) {
$( ‘.job_filters’ ).each( function() {
var target = $( this ).closest( ‘div.job_listings’ );
var form = target.find( ‘.job_filters’ );
var initial_page = 1;
var index = $( ‘div.job_listings’ ).index( target );if ( window.history.state && window.location.hash ) {
var state = window.history.state;
if ( state.id && ‘job_manager_state’ === state.id && index === state.index ) {
initial_page = state.page;
form.deserialze( state.data );
form.find( ‘:input[name^=”search_categories”]’ ).not(‘:input[type=”hidden”]’).trigger( ‘chosen:updated’ );
}
}target.triggerHandler( ‘update_results’, [ initial_page, false ] );
});
});
});
}////
Please let me know if this looks ok. So far, still only the loading image gif is appearingForum: Plugins
In reply to: [WP Job Manager] Using Job Manager plugin within pjax environmentI created a js function to load all of your wp-job-manager scripts after a pjax load, like this:
function jobs() {
$.when(
$.getScript( “/wp-content/plugins/wp-job-manager-applications/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager-career-builder-integration/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/js/jquery-chosen/chosen.jquery.min.js” ),
$.getScript( “/wp-content/plugins/wp-job-manager-indeed-integration/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager-resumes/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/js/ajax-filters.min.js” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/css/frontend.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/css/chosen.css” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/images/ajax-loader.gif” ),
$.getScript( “/wp-content/plugins/wp-job-manager-indeed-integration/assets/images/jobsearch.gif” ),
$.getScript( “/wp-content/plugins/wp-job-manager/assets/images/company.png” ),
$.Deferred(function( deferred ){
$( deferred.resolve );
})
).done(function(){});
}The only thing that seems to show up now is the ajax loader gif I believe. Is there anything else that you think I could try?
Forum: Plugins
In reply to: [WP Job Manager] Using Job Manager plugin within pjax environmentThanks, could you point me to which scripts I should be looking for?