Why isn’t this youtube shortcode working?

echo do_shortcode(‘https://www.youtube.com/watch?v=vZBCTc9zHtI’); Is merely printing https://www.youtube.com/watch?v=vZBCTc9zHtI” out onto the page. I know I can display the video with html with <iframe src=”http://www.youtube.com/embed/vZBCTc9zHtI” width=”560″ height=”315″ frameborder=”0″ allowfullscreen></iframe> but I’m trying to leverage wordpress’ built-in methods. How do I do this? 4 Answers 4 I think this is what you are looking for: <?php echo wp_oembed_get(‘https://www.youtube.com/watch?v=vZBCTc9zHtI’); ?> … Read more

What is a short code?

I am new to WordPress and I’ve seen this term passed around. 3 Answers 3 “Shortcode” is a user friendly way of inserting various WordPress plugins/scripts into a page without having to know a lot of fancy HTML/JavaScript/PHP in order to make it happen. Take, for example, embedding an mp3 file into a post on … Read more

Remove empty p-Tags in Shortcode content before non p-Tags

We build a media (based on bootstrap 4 media object) shortcode with the following syntax: [media img=”https://via.placeholder.com/64×64.png”]<h5>List-based media object</h5>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.[/media] … Read more

WordPress auto adds p to shortcode parameters

WordPress auto adds p tags around shortcode parameters. Is there any way to stop this ? function minimum_working_example ( $atts, $content ){ extract(shortcode_atts(array( ‘html’ => ”, ), $atts)); return ‘<span data-html=”‘.$html.'”></span>’; } shordcode call: [min_example html=”<ul>stuff</ul>”] what ends up being rendered: <span data-html=” <ul>stuff</ul> <p>”></span> desired output is something along the lines of: <span data-html=”<ul>stuff</ul>”></span> … Read more

Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?

I’ve found this new plugin http://wpsmith.net/wordpress/creating-multiple-custom-menus-in-wordpress-3-1 that is using a new 3.1 hook (wp_nav_menu_objects) to remove specific nav-menu-items from the nav-menu-item array before they are parsed by the walker class, if a user isn’t logged in. The plugin uses a specific CSS-class as identifier to decide which items to remove. So I’ve been wondering if … Read more

Browser title script ignoring is_page /else conditional [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years … Read more

other shortcodes in Contact form 7 MAILS [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic. Closed 7 years ago. Improve this question How to use … Read more

How the widget can be run by shortcode

I have my own widget, that uses WP_Widget class, and executes its code inside function in this class. Is there any ways to run this widget using shortcode inside post? This is how my widget structure looks like: add_action( ‘widgets_init’, ‘register_my_widget’ ); function register_my_widget() {} class My_Widget extends WP_Widget () { function My_Widget() {} function … Read more

change wordpress gallery shortcode to slider

Hi I wanted to change the default WordPress gallery short-code and make it a slider. remove_shortcode( ‘gallery’ ); function gallery_filter( $atts, $content = null ) { extract(shortcode_atts(array(‘gallery_name’ => ”), $args)); $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => 3, ‘post_parent’ => $post->ID, ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order’, ‘post_mime_type’ => ‘image’ ); $output .= ‘<script … Read more