Skip to content

Instantly share code, notes, and snippets.

View MichaelSmeal's full-sized avatar
💜

Michael Smeal MichaelSmeal

💜
View GitHub Profile
@nickolasburr
nickolasburr / console.php
Created April 8, 2016 13:57
Log PHP data structures in browser console
<?php
// log information to JS console
function consoleLog ($value) {
echo '<script>console.log(' . json_encode($value) . ')</script>';
}
@jawinn
jawinn / primary_category.php
Last active December 8, 2022 21:42
Display Primary Category (Yoast's WordPress SEO)
<?php
/**
* Get the Yoast primary category from its post meta value, and displays it, with HTML markup.
* If there is no primary category set, it displays the first assigned category.
*
* @param boolean $useCatLink Whether to link the category, if it exists
* @return void
*/
function yourtheme_display_yoast_primary_category( $useCatLink = true ) {