using a shortcode in a hyperlink

Don’t use double quotes (“) inside the shortcode, since you are using double quotes to specify the href attribute. The browser thinks your href text ends at position=. Use single quotes instead: href=”https://wordpress.stackexchange.com/reservation/?unitrate=[print_csv position=”5′]&… I agree with the comments that there is a better way to do this, but I provide a potential answer anyway … Read more

How to translate WP plugin name?

I didn’t find the right way but figured out this way: if (get_locale() == ‘fa_IR’) { parent::__construct( ‘araccordion_widget’, __(‘افزونه وردپرس’, $text_domain), array( ‘description’ => __( ‘توضیحات افزونه به زبان فارسی در اینجا نوشته میشود.’, $text_domain ), ) ); } else { parent::__construct( ‘araccordion_widget’, __(‘WordPress Widget’, $text_domain), array( ‘description’ => __( ‘The description in English, goes … Read more

Hook for single product thumbnail

Here’s what I believe is an updated version of one of the other answers’ comments. This function replaces the width and height attributes, but OP wanted to change the src. I imagine the solution would be similar, except using preg_replace to replace the src instead. add_action(‘woocommerce_single_product_image_thumbnail_html’,’remove_single_product_image_attrs’,10,2); function remove_single_product_image_attrs( $sprintf, $post_id ){ return preg_replace( ‘/(width|height)=”\d*”\s/’, “”, … Read more

Error 404 blog/page/2/

I guess you don’t need to target a taxonomy. You can use the code below: function query_change_function( $query ) { $query->set( ‘posts_per_page’, 5 ); } add_action(‘pre_get_posts’, ‘query_change_function’); You should wrap the $query->set( ‘posts_per_page’, 5 ); around with if ( ! is_admin() && is_home() ) {//the $query->set code} to avoid it changing to 5-posts everywhere.

plugin backend help

I’m not completely sure what you want, but I noticed with position that echo not always give the right position try to build up a large string and then echo the complete results or just return the results. like this: $output .= echo $prefix; $output .= echo $tweetprefix; $output .= echo $cleaner[0]; $output .= echo … Read more