#WordPress Developement Sources
Last active
November 11, 2017 15:10
-
-
Save luis-pinheiro/491ee022f97926657462 to your computer and use it in GitHub Desktop.
WordPress
This file contains 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 | |
$args = array( | |
'post_type' => 'work' | |
); | |
$the_query = new WP_Query( $args ); | |
?> |
This file contains 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
/************************************* | |
* 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