Skip to Content
Menu

Frequently Asked Questions

Last Modified: May 2, 2023

Have a question that isn’t answered here?

Use the Discussions tab on the Github repo »

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!
    • How do I add my logo?

      Using the WordPress Customizer is the easiest and fastest way to handle this. Use the “Brand” section to upload a full-color and one-color version of the logo, then in the “Home” section you can choose which version to use in the header.

    • How do I add a Bootstrap button for my tertiary brand color?

      Use the Sass mixin add-color-class(). More info here »

    • How can I switch to Font Awesome Pro?

      You’ll simply need to deregister Nebula’s bundled version of Font Awesome Free and re-register Font Awesome Pro with the same handle. This is done in your child theme functions file. Instructions and code snippet here »

    • How do I use the service worker?

      Service workers have many benefits from reducing load time to being able install and work offline– just like an app. For background about service workers, here is more information »

      Nebula provides a stock service worker file in the /resources/ directory of the child theme. Simply move this file to the root directory of your website and then be sure to enable the Service Worker option in Nebula Options.

    • How do I cache and compress files?

      Nebula provides a stock .htaccess file in the /resources/ directory of the child theme. Simply move this (or copy/paste the parts you want) to the root directory of your website. Be sure to follow the “@todo” instructions at the top.

      Problems here can cause a 500 error on your website, so be very careful!

    • How do I enable the TODO Manager and Developer Information dashboard metaboxes?

      In Nebula Options under the Administrative tab, make sure you add either an IP address or email domain (or both) for developers. Then ensure the corresponding toggle is enabled for the metaboxes themselves. You should then see them appear on the dashboard.

    • How do I find the "handle" to get a Nebula Option?

      For developers, the Nebula Options page itself provides the actual handles for each option. Simply click the “(?)” icon for the desired option to see it.

      If you don’t see it, make sure you’ve updated the Administrative options to include the IP or email domains of developers.

      All Nebula option handles can be viewed here as well »

    • Does Nebula provide stock Regular Expressions (RegEx)?

      Yes. Nebula provides some stock RegEx in JavaScript. These can be found in the nebula object as nebula.regex and can be modified/overwritten in your child theme’s main.js file.

    • How should I setup Google Analytics to work best with Nebula?

      It’s difficult to summarize this, but Nebula provides tons of analytics assistance. Some of them you won’t need to do anything to benefit from, but others will need to be setup in Google Analytics first (like Goals and Custom Definitions).

      This list of recommendation touches on many of them »

    • Does Nebula support Google Tag Manager?

      Yes! You can enter a GTM ID instead of a Google Analytics Tracking ID and Nebula will understand you are using GTM. You are responsible for the GA data connection via GTM, and likewise you will need to “listen” for event tracking yourself. However, Nebula does push its events to the datalayer for you to utilize.

      Nebula also “announces” when its generic listeners are triggered by the user along with all the data it captured. Use the nebula_event event listener for this. Instructions for that here »

    • Where can I find an example Contact Form 7 code snippet?

      To best utilize Nebula for user experience and analytics, you’ll want to make sure all of the proper classes are applied to your CF7 form.

      Nebula provides examples for Contact Form 7 settings here »

    • How do I deregister/dequeue styles and scripts from other plugins?

      I wrote instructions here to walk through how to use several Nebula features to find and deregister third-party assets.

    • How do I output the "internal search keywords" text in each post?

      This can be output with the following code: <!--?php echo get_post_meta($id, 'nebula_internal_search_keywords', true); ?-->

      Remember that these are not to be used for keyword stuffing for SEO. This text area is strictly meant for aiding internal searches/filters with synonyms, plurals, and alternate spellings (like common typos).

    • How can I do output debugging on AJAX (or other behind-the-scenes functionality)?

      Nebula provides a PHP debug_log() function that writes a timestamped message to a file in the active theme. This can be used if other debug methods fall short.

    • How can I hook into a Nebula function to modify how it works?

      If there is a hook available, you can use that (instructions here). Otherwise, you can overwrite the function with the same name to modify how it works entirely.

    • What is the most optimal way to load JavaScript or CSS?

    • How do I verify a WP nonce in PHP with Nebula?

      Nebula creates a nonce and localizes it to JavaScript as nebula.site.ajax.nonce. On the server-side in PHP you can verify it as nebula_ajax_nonce with the following example:

      if ( !wp_verify_nonce($_POST['nonce'], 'nebula_ajax_nonce') ){ die('Permission Denied.'); }

      Make sure the nonce is passed from the JS call!

    • How do I measure my PHP server-side performance with Nebula and Query Monitor?

      Use the Nebula timer() function which will record the duration of the task and log it in several places including Query Monitor. At page load, in the Query Monitor Admin Bar menu choose “Timings” to see the duration and memory usage of your functionality.

      From there you can use any number of optimization techniques such as conditionals, transients, object cache, etc. to improve the performance.

    • How do I permanently "ignore" Nebula warnings?

      Use the nebula_warnings action (which passes an array of warnings) and then unset the ones you would like to ignore. Example:

      PHP
      add_action(&#8216;nebula_warnings&#8217;, function($nebula_warnings){
      unset($nebula_warnings[&#8216;child_meta_graphics&#8217;]); //Unset the Child theme meta graphics warning
      return $nebula_warnings;
      });
      
    • Is it possible to disable all Nebula remote requests?

      Yes, and functionality (parent or child theme) that uses nebula()->remote_get() can be deactivated in whole or logically per request using the following filter:

      PHP
      add_filter(&#8216;disable_nebula_remote_get&#8217;, function($default, $url){
      if ( strpos($url, &#8216;github.com&#8217;) !== false ){
      return true; //Disable certain remote gets
      }</p>
      <p>return true; //Returning true disables all remote gets
      return false; //Return false allows all remote gets
      }, 10, 2);
      
    • How to get Nebula's custom events into my third-party analytics platform (like SharpSpring or Salesforce)?

      Nebula triggers a DOM event when an analytics event is tracked with the handle nebula_event (it also pushes the event to the DataLayer which is available in Google Tag Manager or any other system that listens to the DataLayer).

      JavaScript
      document.addEventListener(&#8216;nebula_event&#8217;, function(e, details){ //Or use jQuery if preferred
      console.log(&#8216;event triggered:&#8217;, details); //Do something with the event details object
      });
      
    • How to get Nebula's custom dimensions into my third-party analytics platform (like Hotjar)?

      Nebula triggers a DOM event when a dimension is ready to be set in an analytics platform. However, this happens before typical DOM Ready events, so you’ll need to use a WP action with the DOM event listener. Here is an example for Hotjar (this goes in your functions file):

      PHP
      add_action(&#8216;nebula_ga_before_dimensions&#8217;, function(){
      ?>
      //No
      <script> tag because this is already inside of a JavaScript tag
      document.addEventListener('nebula_dimension', function(e){ //Avoid jQuery because it may not be ready
      console.log('dimension triggered:', e.detail.name, e.detail.value); //This event provides a name and a value
      hj('tagRecording', [e.detail.name]);
      });
      <?php
      });
      

      Note: Google Analytics, Microsoft Clarity, Facebook, and Hubspot have some pre-bundled tagging in Nebula already. Do some testing (and read through available Nebula Options) before taking the time to code your own event listeners.

    • How to use the JavaScript WordPress Hooks API?

      There are several types of hooks in the JS API. A quick example to add a button class to the current selector would be:

      JavaScript
      wp.hooks.addFilter(&#8216;nebulaButtonSelectors&#8217;, &#8216;child&#8217;, function(selector){
      return selector + &#8216;, .new-class&#8217;;
      });
      

      The above code must execute in JS before the filter is applied! Considering using it in DOM Ready (outside of a module).

      In-depth instructions here.