GitHub Gist Shortcode
-
Hate to be Debbie Downer, but given the time and ‘vote count’, combined with the lack of response from WPCOM staff at this point, is this hopeless?
-
-
Thanks for the feedback so far everyone. I’ll post this request in our user suggestion list. Keep the votes coming if you are interested and haven’t already left a reply on this thread.
-
@designsimply – is that ‘user suggestion list’ public? (like on uservoice or something?) Is there anything we can do to help make it happen outside of adding comments? Does it make a difference if we’re paid users?
-
Hi guys,
Gist would be a great service to support so I’ve tossed together some code to allow embedding.
Here’s the valid formats to embed gists:
https://gist.github.com/2314628[gist 2314628 /] [gist https://gist.github.com/2314628 /] [gist]2314628[/gist] [gist]https://gist.github.com/2314628[/gist]This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters<?php $query_args = array( 'foo' => 'bar', 'apple' => 'orange', 'posts_per_page' => 50, 'offset' => 0, ); $some_posts = new WP_Query( $query_args ); while ( $some_posts->have_posts() ) { /* * Do some stuff here */ // Get more posts $query_args['offset'] = $query_args['offset'] + $query_args['posts_per_page']; $some_posts = new WP_Query( $query_args ); } Those first two are URLs on their own lines, not hyperlinked (clickable). You can also go the shortcode route if you prefer (the last four examples).
-
@designsimply – is that ‘user suggestion list’ public? (like on uservoice or something?) Is there anything we can do to help make it happen outside of adding comments? Does it make a difference if we’re paid users?
manningj, the list isn’t public. Comments are the way to go. It doesn’t make a difference about being a paid user or not. Sometimes we can get new features added, sometimes not–it depends on a lot of factors. :)
As you can see… viper007bond added a gist shortcode for you guys! w00t!
viper007bond, thank you. :)
-
Awesome viper007bond – thanks!
Is there any way to specify an individual file within a gist? For example, I have this embed code for a single line of HTML which I’d love to embed within a post, in addition to other snippets from the same gist:
<script src="https://gist.github.com/2362963.js?file=button1.html"></script>
Thanks again – even without the individual file selection this is a great update.
-
Sure, no problem. Use the “file” shortcode parameter to do it. Examples:
[gist https://gist.github.com/2372005 file="file2.php" /] [gist file="file2.php"]https://gist.github.com/2372005[/gist] -
-
Awesome!!! Just made use of the gist on my website using different files!!!
Happy gist on WordPress!!!
- The topic ‘GitHub Gist Shortcode’ is closed to new replies.