Relative post date in recent posts list

You don’t generate a WP Loop using wp_get_recent_posts() so get_the_time() won’t pull the post date. The post date is available within the array wp_get_recent_posts() returns though: $recent[‘post_date’]. Or you can use the modified date: $recent[‘post_modified’]. This works (tested on my dev site): <?php $args = array( ‘post_status’ => ‘publish’, ‘numberposts’ => ’30’, ‘tax_query’ => array( … Read more

Missing hashtag with theme customizer header color

Already fixed it. When saving it to the database the hashtag is filtered out. So with echoing the color, I just put a hashtag before it, like this: function cloudboxx_customize_register( $wp_customize ) { //All our sections, settings, and controls will be added here $wp_customize->add_setting( ‘header_textcolor’ , array( ‘default’ => “#000000”, ‘transport’ => ‘refresh’, ) ); … Read more

Load get_page_templates into select menu

Reading the documentation: List of choices for ‘radio’ or ‘select’ type controls, where values are the keys, and labels are the values. And again for get_page_templates(): Return value: (array) Where key is the name of the template and value is the filename. Thus we can conclude: ‘choices’ => array_flip( get_page_templates() ), Now I’m spoiling you