• Resolved emilyhint

    (@emilyhint)


    Hello! I purchased the pro version in order to disable the banner on all except a few pages. Unfortunately with the way it is configured, it does not give the option to disable the plugin on any of the LearnDash course pages. Is there a way to instead ENABLE the banner on just a few pages?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author rpetersen29

    (@rpetersen29)

    Hi @emilyhint Yes you can put this in your Website Custom Javascript

    document.addEventListener('DOMContentLoaded', function(){
      if (!window.location.pathname.includes("/learndash/")){
        document.getElementById('simple-banner').remove();
      }
    }, false);
    

    And replace /learndash/ with something common in your LearnDash course urls. If you need it for multiple urls that are all very different let me know the urls and i’ll give you another solution.

    Hello,

    What if we only want the banner to appear on certain custom post type urls like:

    /lesson/
    /topic/
    /reflection/

    Thank you,
    John

    • This reply was modified 3 years, 11 months ago by John.
    Plugin Author rpetersen29

    (@rpetersen29)

    Hi @johnmcole
    Same type of thing though i’ll include an additional removal if you have custom CSS for your site to make the banner fit:

    document.addEventListener('DOMContentLoaded', function(){
      var pathnames = [
        "/lesson/",
        "/topic/",
        "/reflection/"
      ];
      if (!pathnames.includes(window.location.pathname)){
        if (document.getElementById('simple-banner-site-custom-css')) document.getElementById('simple-banner-site-custom-css').remove();
    	if (document.getElementById('simple-banner-header-margin')) document.getElementById('simple-banner-header-margin').remove();
    	if (document.getElementById('simple-banner-header-padding')) document.getElementById('simple-banner-header-padding').remove();
    	if (document.getElementById('simple-banner')) document.getElementById('simple-banner').remove();
      }
    }, false);
    

    Make sure your pathname include the entire pathname, so the pathname for this support topic would be "/support/topic/select-pages-to-enable-banner-on/".

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Select pages to enable banner on’ is closed to new replies.