Add audio file to post using custom term meta field as link [closed]

I figured it out! Using this code I was able to use my custom meta field as the link in the audio shortcode. First I created a function in functions.php: function audio_link() { $terms = get_the_terms($post->ID, ‘taxonomy-name’); $result = “”; if (is_array($terms) || is_object($terms)){ foreach ($terms as $term) { $term_id = $term->term_id; $result .= get_term_meta( … Read more

create a shortcode for embedding google map in a page

function bartag_func( $atts ) { $atts = shortcode_atts( array( ‘latitude’ => ‘28.66’, // default value ‘longitude’ => ‘99.25’ // default value ), $atts, ‘bartag’ ); return <div class=”” latitude=” ‘.$atts[‘latitude’].’ ” longitude=” ‘.$atts[‘longitude’].’ “></div>’; } add_shortcode( ‘bartag’, ‘bartag_func’ ); Now you can use shortcode like : [bartag latitude=”12.34″ latitude=”12.34″] will return : <div class=”” latitude=”12.34″ … Read more

shortcode display metainformation as linked image

@WebElaine is correct. I had to use the wp_get_current_user(); and remove global. This is what worked for me function download_to_wallet() { $current_user = wp_get_current_user(); // get current user’s information $qr_url = $current_user->qrbase_code_pass_url; return ‘<a href=”‘. $qr_url . ‘”><img class=”qr_download” src=”https://example.com/wp-content/uploads/2018/08/add-to-apple-wallet-logo.png” style=”width:200px;”></a>’; }

How to strip header tags & shortcodes from the_excerpt()

Remove Shortcodes First, try this on your functions.php: add_filter( ‘get_the_excerpt’, ‘strip_shortcodes’, 20 ); If it doesn’t work then try this edit. echo strip_shortcodes( get_the_excerpt() ); In case the shortcode is not registered with WordPress function add_shortcode add_filter( ‘the_excerpt’, ‘remove_shortcodes_in_excerpt’, 20 ); function remove_shortcodes_in_excerpt( $content){ $content = strip_shortcodes($content); $tagnames = array(‘box’, ‘alert’); // add shortcode tag … Read more

Function in a wordpress shortcode

I don’t think you want the display name – it may not be unique. Try using the log-in name instead. The user name for the displayed profile: $myhope = bp_get_displayed_user_username(); The user name for the current user: $current_user = wp_get_current_user(); $myhope = $current_user->user_login;

Convert WordPress shortcodes into plain html

First of all, you have a syntax error. If your shortcode is stored in the $output variable, you would need to call echo do_schortcode($output);. But, wouldn’t simply the_content(); do the trick? I believe the shortcodes would be processed if you do this. You can make a new query with WP_Query, and then use the_content() in … Read more

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