basicguy Posted August 21, 2015 Share Posted August 21, 2015 Hi, I'm trying to place a 'Page Peel' script onto my website to advertise Sale Items - Got the 'Peel' working but the problem is, I only want it to appear on the 'Home' Page.I've tried adding a basic bit of PHP to determine the URL but I think that the 'HTTPS' combined with the '.htaccess' are preventing me getting the correct one, so my if/else script doesn't work.Can anyone assist? Quote Link to comment Share on other sites More sharing options...
bsmither Posted August 21, 2015 Share Posted August 21, 2015 On the Homepage, there is one or two identifiers you can use to activate the script: the class home_wrapper and, if your Homepage has a Homepage Document, the ID content_homepage.With either of these, you can use them in a jQuery selector to determine if the object element is real or null. Quote Link to comment Share on other sites More sharing options...
basicguy Posted August 21, 2015 Author Share Posted August 21, 2015 (edited) Thank you for the assistance.I'm checking for the 'announcement' div which is the 'Welcoming Text' on the home page within the home page document... but am still not getting the correct resultAt the footer of main.php I include:test.js Contents: if ($(".announcement" ) ) { alert('does exist'); // Appears correctly //writeObjects(); // Script Starter} else{ alert('does not exist');}Have subsequently tried this with: content_homepage, home_wrapper, latest_product plus several others that ONLY appear on the home page and yet the 'Peel' Still appears on every page. Help!!I am a schmoe! Wrote the jQuery wrong! Should have been: if ($('#announcement').length > 0) { writeObjects();} Note the two stoooopid errors!Thanks again for the help! All working now. Edited August 21, 2015 by basicguy I'm an idiot! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.