Skip to content

Instantly share code, notes, and snippets.

@luis-pinheiro
Last active November 11, 2017 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save luis-pinheiro/491ee022f97926657462 to your computer and use it in GitHub Desktop.
Save luis-pinheiro/491ee022f97926657462 to your computer and use it in GitHub Desktop.
WordPress
<?php
$args = array(
'post_type' => 'work'
);
$the_query = new WP_Query( $args );
?>
/*************************************
* allow php execution in text widget *
*************************************/
add_filter('widget_text','execute_php',100);
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
}
/**
* Display site tagline
*/
bloginfo('description');
/**
* Site Url
*/
bloginfo('siteurl');
/**
* Display category title
*/
single_cat_title();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment