include shortcode values in Thickbox form
Try something like this… var code = $(‘div#wp-content-editor-container textarea’).text().match(/\[(schema.*)\]/); code=”<” + code[1] + ‘>’; alert($(code).attr(‘description’));
Try something like this… var code = $(‘div#wp-content-editor-container textarea’).text().match(/\[(schema.*)\]/); code=”<” + code[1] + ‘>’; alert($(code).attr(‘description’));
You might want to take a look at the wp_enqueue_script() documentation and modify your code to follow standard WordPress practice. Then look at your output and verify that your JS is being loaded.
<a href=”https://wordpress.stackexchange.com/questions/77197/<?php bloginfo(“template_url’); ?>/auction_price.php”>Order by price</a> auction-price.php is inside the template directory. Then you can’t include wp-blog-header.php using require(‘./wp-blog-header.php’) inside template directory. Therefore do_shortcode() is not working without WordPress. The proper way to use ajax in WordPress is via admin-ajax.php Read More at Codex: http://codex.wordpress.org/AJAX_in_Plugins For example, in your functions.php: function wpse_77197_auction_price(){ echo do_shortcode(‘[wpa_list_widget mode=”list” … Read more
I created a fiddle for anyone that is interested HERE. Here is the javascript I used also to give the smooth scroll for an article container. // clicking the links in the article link container $(‘#article-links a’).click(function() { var $this = $(this); // save this instance of the click for access inside the loop // … Read more
Alternative approach: <li class=”cycle-item slide-<?php echo $i; ?>”> <span class=”featured-title”><?php the_title(); ?></span> <a href=”https://wordpress.stackexchange.com/questions/97055/<?php the_permalink();?>”><?php the_post_thumbnail(‘featured’); ?></a> </li> then hide the span with CSS, show it on hover of the <li> element, position it over the image with CSS. Example: li.cycle-item { position: relative; } li.cycle-item .featured-title { display: none; } li.cycle-item:hover .featured-title { display: … Read more
Just found out that reCaptcha actually rejects CAPTCHAs which are submitted to their server more than once. Since I was using the WP-reCAPTCHA plugin, the plugin resubmitted the CAPTCHA after my AJAX submission. So I just commented out a line from the plugin that does the submission, which is in file recaptcha.php, line 27: $this->register_filters();
Setting an input to “read only” by whatever means, Javascript or PHP generated or hard-coded markup, has zero security value. It is trivial to remove that “lock” with FireBug or the Web Developer extension, and I am sure others as well. What you are doing is cosmetic at best. If you want to prevent the … Read more
You cannot use the $ selector freely like this, because WordPress loads jquery in noconflict mode. The most common workaround is to wrap all functions in your script file: jQuery(document).ready(function($) { … scripts … } If you want to put the script directly in the head of the file (not recommended) it would go like … Read more
Your jQuery code is using the $ symbol without accounting for noConflict mode. More information: http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers
Download the script (or add it via npm > bower to your theme), wp_enqueue_script() it at the wp_enqueue_scripts hook and then simply add/enqueue another (your custom) script where you add the contents of the demo index.html file: ( function( $ ) { $( “img” ).photoResize( { bottomSpacing: 15 } ); } )( jQuery || {} … Read more