User name in referral URLs
User name in referral URLs
User name in referral URLs
I would suggest using do_shortcode as mozboz suggested. But I think that using the single.php file is a better way of doing it. The template you should use will depend on how your theme is structured, but if the element is supposed to always display after a post then editing the main template is the … Read more
insert this code in your theme functions.php and use this shortcode [users_count_bro] to display where you want function total_count_bro() { $out=””; $user_count_data = count_users(); $avail_roles = $user_count_data[‘avail_roles’]; foreach ( $avail_roles as $role_key => $role_count ) { $out .= $role_key.’:’.$role_count.'<br/>’; } return $out; } add_shortcode( ‘users_count_bro’, ‘total_count_bro’ );
Your shortcode can look like this: [check-if-empty usermeta=”last_name”] Is not empty [/check-if-empty] The parameter called “usermeta” is added to your function ($atts) and it’s value is used to check the userdata. function func_check_if_empty( $atts, $content = null ) { if ( is_user_logged_in() ) { /* check if logged in */ $user_meta = $atts[‘usermeta’]; /* get … Read more
Shortcode won’t automatically execute. I order to achieve your result you need to apply a filter. When you echo the value of your metabox in frontend do it like this: echo apply_filters( ‘the_content’, YOUR_METABOX_VALUE_HERE ); this way contact form shortcode will execute and form will show.
How to use multiple (or array) values in $content of shortcode?
You can test if a post has a particular term assigned to it with the has_term function. E.g. if ( has_term( ‘term-slug’, ‘taxonomy-slug’ ) ) { // do stuff } With this you can test if your “post” has a particular “term” ( aka if your “product” has a particular “product_cat” )
Use a global and set the value to $atts.
Date Shortcode in Image alt and title tags
shortcode to display specific recent posts