Advanced search by two criteria – sort by location and date (ascending or descending)

I finally found a solution. For those who might also stumble on this. What I had to do is to put ASC and DESC as option values for the date sorting. I read in the documentation that WordPress uses these values by default to sort data. <select class=”dropdown-class” name=”order” id=”sortbox”> <option value=”DESC”>Newest</option> <option value=”ASC”>Oldest</option> </select> … Read more

Add image to menu item with ACF

get_field() gets the field for the current post in the loop, but the loop isn’t used for menu items, so you need to specify which post you want to get the value from. In the case of menu items, each nav menu item is a WP_Post object, so you want to pass that: foreach( $items … Read more

Firing schema via code in functions.php doesn’t work

The more cleaner way of adding the custom data to your site’s <head> is to use a custom function, which you hook to a relevant action. In this case you could for example utilize the wp_head action. Like so, // this goes to functions.php file add_action(‘wp_head’, ‘insert_my_page_schema’); function insert_my_page_schema() { // only execute the code … Read more