WordPress sorting posts by date and title using a dropdown

Here I put orderby attributes as option values – date and title. <form method=”GET”> <select name=”orderby” id=”orderby”> <option value=”date”>Newest to Oldest</option> <option value=”title”>Alphabetical</option> <button type=”submit”>Apply</button> <form> On the same page you can recieve select value and set as orderby attribute $wpb_all_query = new WP_Query(array( ‘post_type’=>’post’, ‘posts_per_page’=>-1, ‘order’=>’ASC’, ‘orderby’=> esc_attr($_GET[‘orderby’]) ); Use your loop to show … Read more

array wordpress when get is null

One option is to use PHP function empty() and the AND / && operator to build your if check to be certain that all of the required parameters are present. if ( ! empty( $type_search ) && ! empty( $area_search ) && ! empty( $prezzo_search ) && ) { // your ocde } P.s. type … Read more

Change plugin descriptions

Yes, there is a filter you can use — all_plugins: apply_filters( ‘all_plugins’, array $all_plugins ) Filters the full array of plugins to list in the Plugins list table. And here’s an example which changes the description of the Akismet plugin: add_filter( ‘all_plugins’, ‘my_all_plugins’ ); function my_all_plugins( $all_plugins ) { // the & means we’re modifying … Read more