Strange result of get_stylesheet_directory()

Backslash is the default used on Windows OS to define paths. The foward slash is the default in Apache’s config on Xampp (at least it always have benn like that on mine). Since Windows accept both, you have a mix of them. But that won’t do any harm to your WordPress project. And it will … Read more

How to sort (orderby) a query done by a template function before the ‘foreach’ loop?

Without knowing what Realia_Post_Type_Property::get_properties() does and returns, this is a bit tricky to answer. But essentially, you want to to sort an array using PHP. Unless Realia_Post_Type_Property::get_properties() allows you to get a sorted list of posts, your best bet is probably to use wp_list_sort(). That function sorts a list of objects, based on one or … Read more

Open/closed function [closed]

I’ve sourced the CSS from https://codepen.io/vram1980/pen/Kyaie all credit above. Putting it with your function, you can do something like this: add_shortcode( ‘linestatus’, ‘line_status_handler’ ); function line_status_handler( $atts ) { extract( shortcode_atts( array( ‘open_time’ => ’09:00:00′, ‘closed_time’ => ’17:00:00′, ‘open_text’ => ‘our lines are open’, ‘closed_text’ => ‘our lines are closed’, ), $atts ) ); $opened … Read more