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 loop through a custom post type using a shortcode and output each element in the loop using shortcodes

Probably you need to create a shortcode with parameters. You should have different parameters for font size, color, bold, underline or anything else. The user should insert a value for each of these parameters in the shortcode. You can find what you need here https://developer.wordpress.org/plugins/shortcodes/shortcodes-with-parameters/ It is a little tricky though because you must check … Read more

Using $variable in shortcode

If you’re using PHP > 5.3, then you can use a closure on the the_content filter. This filter needs to be added after the $variable has been defined and before the the_content filter has fired. add_filter( ‘the_content’, function( $content ) use ( $variable ) { return str_replace( ‘[variable][/variable]’, $variable, $content ); } ); Shortcodes are … Read more

Shortcode not picking up custom field

could be a question of string concatenation – try (untested): <a href=”‘.get_permalink().'” title=”‘.get_the_title().'”><img src=”‘. get_bloginfo(‘template_directory’).’/timthumb.php?src=”.$thumb.”&h=100&w=600&zc=1&q=100&a=”.get_post_meta($post->ID, “thumbcrop’, true).'” alt=”‘.get_the_title().'” /></a>

Wpautop stops working after get_the_excerpt

wpautop has got to be my least favorite part of working with WordPress. Just when everything else is working, it sticks its fingers into everything… The problem has to do with filter priority, as you noted earlier. In the case of the excerpt, we’re interested in the filter get_the_excerpt. I haven’t been able to figure … Read more

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