May 30, 2017

PHP function humanize

function humanize($str){
return ucwords(str_replace(array('_', '-'), ' ', $str));
}

Last updated: May 30, 2017

Option field value not loading on Archive page – WP_Query



 
<?php
global $development_logos;
add_action('init', 'development_logos');
function development_logos(){
global $development_logos;
$development_logos = get_field('development_logos','option');
}
function dev_logos_func( $atts ){
global $development_logos;
$devLogos = '<div id="logos">';
foreach($development_logos as $the_row){
$devLogos .= '<a href="'.$the_row['dev_url'].'" target="_blank">'.$the_row['dev_name'].'</a><div class="logosTxt">'.$the_row['dev_text'].'</div>';
}
$devLogos .= '</div>';
return $devLogos;
}
add_shortcode( 'dev_logos', 'dev_logos_func' );

Last updated: May 30, 2017