WordPress Multiple Taxonomy Query

Perhaps you can add a hidden field to the HTML which will pass the ‘relation’ => ‘OR’. <input type=”hidden” name=”tax_query[relation]” value=”OR”> <select name=”tax_query[][country]” multiple> <option value=”united-kingdom”>United Kingdom</option> <option value=”ireland”>Ireland</option> </select> <select name=”tax_query[][type]” multiple> <option value=”director”>Director</option> <option value=”partner”>Partner</option> </select> Which translates to: tax_query[relation]=OR&tax_query[][country]=united-kingdom&tax_query[][type]=director Array ( [tax_query] => Array ( [relation] => OR [0] => Array ( … Read more

How to Display image from Menu Image in Walker Dropdown Select Menu

It’s stored in metadata, there are four meta fields: _thumbnail_id and _thumbnail_hover_id – store attachment ID, _menu_item_image_size – store selected image size, _menu_item_image_title_position – store label position, but you can get stored values from this properties: $item->thumbnail_id, $item->thumbnail_hover_id, $item->image_size, $item->title_position. Check the menu_image_nav_menu_item_filter() function in menu-image.php

database select issue

“SELECT column FROM table ORDER BY RAND() LIMIT 1 ” or you can add more restrictions to fetch from last 5 by time. Hope it help you a bit

Default URL for category dropdown select option

I found a solution! As I was looking for a fix I ran across this article: https://andrux.net/add-empty-option-to-wp_dropdown_categories/ This is very close to what I was looking for, so I tweaked it. The only thing I did to the form was remove the show_option_none=Select… The form code: <form action=”<?php bloginfo(‘url’); ?>” method=”get” id=”catform”> <?php $parent = … Read more

Get Link of Page Selected through a Select Field in Custom Admin Page

First, you register your setting like this: function my_awesome_register_fields_for_additional_settings(){ register_setting(‘reading’, ‘my_awesome_pagelink_for_frontend_button’); add_settings_field(‘my_awesome_pagelink_for_frontend_button’, ‘<label for=”my_awesome_pagelink_for_frontend_button”>The Frontend Button shall link to this page:</label>’ , ‘my_awesome_pagelink_for_frontend_button_html’, ‘reading’); } add_filter(‘admin_init’, ‘my_awesome_register_fields_for_additional_settings’); After that, you define the callback for your settings field: function my_awesome_pagelink_for_frontend_button_html(){ $option = (int)get_option(‘my_awesome_pagelink_for_frontend_button’,0); wp_dropdown_pages(array( ‘selected’ => $option, ‘name’ => ‘my_awesome_pagelink_for_frontend_button’, ‘show_option_none’ => ‘Please Choose’, ‘option_none_value’ => … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)