Create plugin/function to catch XML-data via Shortcode

If this file is remotely available to you, then you should be using the HTTP API. $response = wp_remote_request( ‘http://xml.prisguide.no/productExport.php?productId=151690’ ,array( ‘ssl_verify’ => true // If the request isn’t working, try it with `false` ) ); You then simply go and catch the response and check if it’s an error: if ( is_wp_error( $response ) … Read more

wp_register_script and wp_register_style when shortcode is used

Your scripts and styles all share the same handle, “fancybox”, which should be unique, and I think that’s your issue. Try this: wp_register_script( ‘mousewheel’, get_stylesheet_directory_uri(‘/js/jquery.mousewheel-3.0.6.pack.js’, __FILE__), array(‘jquery’), ‘3.06’, true ); wp_register_script( ‘fancybox-script’, get_stylesheet_directory_uri(‘/js/jquery.fancybox.js’, __FILE__), array(‘jquery’), ‘1.0’, true ); wp_register_script( ‘fancybox-pack’, get_stylesheet_directory_uri(‘/js/jquery.fancybox.pack.js’, __FILE__), array(‘jquery’), ‘1.0’, true ); wp_register_script( ‘fancybox-buttons’, get_stylesheet_directory_uri(‘/js/jquery.fancybox-buttons.js’, __FILE__), array(‘jquery’), ‘1.0’, true ); wp_register_script( … Read more

custom post types shortode stays on top of other page contents. Is there a bug?

You have this code in your shortcode function: if( count($posts) ): echo ‘<ul id=”portfolio-grid” class=”portfolio-grid unstyled ‘.$post_columns.’-cols”>’; foreach( $posts as $post ) : setup_postdata( $post ); ?> <li> <a href=”https://wordpress.stackexchange.com/questions/104016/<?php the_permalink(); ?>” data-largesrc=”<?php if ( has_post_thumbnail() ) { echo ub_featured_img_url(‘portfolio-fullsize’); } else { ?>http://placehold.it/600&text=<?php _e(‘No Thumbnails’, ‘une_boutique’); } ?>” data-title=”<?php the_title() ?>” data-button=”<?php _e(‘View Project’, … Read more

echo a shortcode in a shortcode code?

You will have to execute do_shortcode() on your $button. $ptoutput .= ‘<div class=”pt-buynow”><a href=”‘ . $url . ‘” class=”mt-button large”>’ . do_shrtcode( $button ) . ‘</a></div>’ . “\n”; Be aware of endless recursions! You may also check if the $button is set as a shortcode, if you want to force one. if ( !has_shortcode( $button, … Read more

I’ve broken the short code for Contact Form 7!

From the codex: The shortcode parser uses a single pass on the post content. This means that if the $content parameter of a shortcode handler contains another shortcode, it won’t be parsed. http://codex.wordpress.org/Shortcode_API The codex also provides the solution to your issue, which is to use the funciton do_shortcode() If the enclosing shortcode is intended … Read more

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