Add addtional page parameter before loading the page

Set a variable $product_view=isset($_GET[‘product_view’]) ? $_GET[‘product_view’] : ‘grid’; Now, how to keep it like this with pagination URL’s. echo paginate_links(array( ‘base’ => add_query_arg(‘product_view’, $product_view), ‘format’ => ”, ‘prev_text’ => __(‘«’), ‘next_text’ => __(‘»’), ‘total’ => ceil($total / $items_per_page), ‘current’ => $page, ‘add_args’ => array( ‘category’ => ‘fruit’, ‘color’ => ‘red’ ) )); I hope this … Read more

How to pass username in url

First, you should check if the user is logged in – use is_user_logged_in(). Next step is to get ID of current user with get_current_user_id(). Next, get the URL for the author with the given ID using get_author_posts_url(). The last step is to display the button with the link. if ( is_user_logged_in() ) { $uid = … Read more

Set URL Parameter Post Layout As Default

I want this to apply to all posts First off, making the content query string defaults to onepage is actually equivalent to enabling the onepage() for all URLs/pages. And for example to enable it by default on single post pages only (for any post types), then you can replace this: if( empty( $_GET[“content”] ) || … Read more

add_action with associative array

You passed the action an associative array, so your hooked function will recieve an associative array. It’s a little clearer if we retype it like this: $associative_array = array( ‘product_id’ => $product_id , ‘outbiddeduser_id’ => $outbiddeduser, ‘log_id’ => $log_id ); do_action( ‘woocommerce_simple_auctions_outbid’, $associative_array ); Thus: add_action(‘woocommerce_simple_auctions_outbid’, ‘test’, 10, 1); function test( $associative_array ) { It … Read more

Post title as link parameter

I think this is what you are trying to accomplish? $html .=”<a id=’test’ rel=”nofollow” href=”https://example.com/cars/?aff=””. echo get_the_title( $post_id ) .” target=”_blank”>”;