Pass additional parameter in the URL

There is a wordpress function for adding $_GET-Params to an URL: add_query_arg(). It works like this: $link = add_query_arg( array(‘pagenum’ => $your_page_number) ); By default it adds the param to the current page (gets content from $_SERVER[REQUEST_URI]) but you can also pass an optional param to the function if you want the link to go … Read more

Order & Orderby Parameters

Hi for me fast solution is to use custom query for eg. $sql=”SELECT `wp_users`.`ID` , `wp_users`.`user_login` , `wp_users`.`user_pass` , `wp_users`.`user_nicename` , `wp_users`.`user_email` , `wp_users`.`user_url` , `wp_users`.`user_registered` , `wp_users`.`user_activation_key` , `wp_users`.`user_status` , `wp_users`.`display_name` , `wp_posts`.`post_date` FROM `wp_users` LEFT JOIN `wp_posts` ON (`wp_users`.`ID` = `wp_posts`.`post_author`) GROUP BY `wp_users`.`ID` ORDER BY `wp_posts`.`post_date` DESC;”; global $wpdb; $results=$wpdb->get_results($sql); foreach($results as … Read more

Dynamically change page title from URL param

You could do something like this in your header.php file (or where ever you are setting your page titles in your templates) <?php if (isset($_GET[‘user’])) : ?> <title>Entries from <?php echo(htmlspecialchars($_GET[‘user’], ENT_QUOTES)) ?></title> <?php else: ?> <title>Normal page title here</title> <?php endif; ?> Without more info on what plugin you are using, or how your … Read more

Get URL Param Plugin and Inserting Result in Widget Code

I think the underlying issue here is that shortcodes are not evaluated when placed inside HTML attributes. You could modify the template and output the necessary HTML using PHP and do_shortcode( ‘[urlparam param=”Book” /]’) as an alternative approach: <!– Calendly inline widget begin –> <div class=”calendly-inline-widget” data-url=”<?php echo do_shortcode( ‘[urlparam param=”Book” /]’ ); ?>” style=”min-width:320px;height:580px;”></div> … Read more

Changing WP_Query params with url Query Var

This code manually sets the order with the ‘order’ => ‘ASC’ declaration in the WP_Query arguments. $loop = new WP_Query( array( ‘post_type’ => ‘product’, ‘meta_key’ => ‘product_price’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘posts_per_page’ => 4, ‘paged’ => $paged) ); If we want to pass a url parameter to that we could use something like: … Read more

Add custom parameter to REST API request of a custom post type?

I solved following this answer and writing: public function query_wasb_messages_by_status( $args, $request ) { if ( ! is_null( $request->get_param( ‘message_status’ ) ) ) { $args[‘meta_query’] = array( ‘_wasb_message_status’ => array( ‘key’ => ‘_wasb_message_status’, ‘value’ => (int) $request->get_param( ‘message_status’ ), ‘compare’ => ‘=’, ‘type’ => ‘numeric’ ) ); } return $args; } add_filter( ‘rest_wasb_message_query’, array( $this, … Read more

wp_parse_args & category parameter

Update 3/5: When I originally answered this question I didn’t realize that your code was almost an exact copy of the wp_get_archives function. There is nothing in your code or the original wp_get_archives code that supports categories. The function was written to get date archives and your defaults are missing the type, limit, before and … Read more

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