In Wordpress Sage main.js können wir seitenspezifische JS laufen:WordPress Sage: Wie fange ich JS auf bestimmten Single oder Archiv CPT-Seiten?
var Sage = {
// All pages
'common': {
init: function() {
// JavaScript to be fired on all pages
},
finalize: function() {
// JavaScript to be fired on all pages, after page specific JS is fired
}
},
// Home page
'home': {
init: function() {
// JavaScript to be fired on the home page
},
finalize: function() {
// JavaScript to be fired on the home page, after the init JS
}
},
// About us page, note the change from about-us to about_us.
'about_us': {
init: function() {
// JavaScript to be fired on the about us page
}
}
};
Aber wie JS auf bestimmte einzelne oder Archiv CPT Seiten laufen?