• Skip to main content
  • Skip to primary sidebar

Purely Supplemental Hub

Just The Tech, News, and Info We Deem To Post

  • WordPress
  • Marketing
  • Business
  • Computing
  • Security
  • Publicity
  • Resources
  • WHATEVS

Open GitHub Gists in New Window in WordPress

Add the following code to your theme’s function.php file, or a functionality plugin to modify Open GitHub Gists in New Window in WordPress.

wp_enqueue_script( 'gist-embeds-new-tab',  get_bloginfo( 'stylesheet_directory' ) . '/js/gist-embeds-new-tab.js', array( 'jquery' ), '1.0.0' );

To open GitHub Gists in a new Window in WordPress adjust the jQuery in the Gist to include the “Target = _Blank” code.

jQuery(document).ready(function($){$('.gist-meta').find('a').attr('target', '_blank'); });

Filed Under: Code Snippets Tagged With: GitHub Gists, New Window

Reader Interactions

Share Your Two Cents Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

© Copyright Jack Alltrade & Associates 2026 · Purely Supplemental™ is a trademark of Jack Alltrade & Associates