Skip to content

Instantly share code, notes, and snippets.

View alisaleem252's full-sized avatar

Ali alisaleem252

View GitHub Profile
@azizultex
azizultex / WordPress Shortcode with ob_start()
Created March 3, 2016 03:16
WordPress Shortcode with ob_start()
function custom_query_shortcode($atts) {
// EXAMPLE USAGE:
// [loop the_query="showposts=100&post_type=page&post_parent=453"]
// Defaults
extract(shortcode_atts(array(
"the_query" => ''
), $atts));
@facelordgists
facelordgists / php-output-buffering.php
Created January 29, 2014 22:51
PHP output buffering. Great for WordPress shortcodes
<?php
// generic usage
ob_start();
?>
<h1>Begin Content</h1>
<p>Content</p>