wp_verify_nonce not working

I don’t know I just submitted the ticket on track. I was using get_current_user_id() and it modifies the wp_create_nonce behavior. Sinces wp_create_nonce uses wp_get_current_user() I think there is the problem.

Accept AJAX call with serialized form data

When working with AJAX and Forms in WordPress I like to code in the ajax action to the form so serialize works out of the box. Actually I wrote an article on this last year: https://webdevstudios.com/2015/02/12/handling-ajax-in-wordpress/ But, you’re here for answers, not a blog article, so here’s the brief part of it. You have three … Read more

Need To Deregister Scripts Via Functions.Php

Ok the following does work now, I think it was a caching issue and I forgot to add the correct priorities Using the priorities now it definitely works and I also managed to de-register Buddypress scripts add_action( ‘wp_print_scripts’, ‘de_script’, 100 ); function de_script() { wp_dequeue_script( ‘jquery’ ); wp_deregister_script( ‘jquery’ ); wp_dequeue_script( ‘bp-legacy-js’ ); wp_deregister_script( ‘bp-legacy-js’ … Read more

HTML5 Youtube wrapper works in jsfiddle but not in WP?

If you are talking about this, I can see it’s working. However, taking a look at the source code, I found you have two instances of jQuery. You might want to remove the first one found just below the opening <html> tag. It’s not only the improper way to enqueue jQuery, but may also conflict … Read more

Load jQuery inside Page Template

You should use the wp_enqueue_script() function to first enqueue your script and then wp_enqueue_scripts action hook to properly add your script to your footer or header of your theme. Also, you should take a look at conditional tags and how they are used to load functions/scripts/styles/etc on a conditional basis. So you would do something … Read more

Adding a character counter to the excerpt metabox

Ok, so I didn’t like the way that was written, so i slightly rewrote it with different syntax, and more readable structure. <?php // Add Character Counter to the Excerpt Meta Box function excerpt_count_js(){ if (‘page’ != get_post_type()) { ?> <script> (function($){ $(document).ready(function(){ if ( $(‘#postexcerpt’).length ) { var maxChar = 128; $excerpt = $(‘#excerpt’); … Read more

WordPress audio player causing js error, mediaelementplayer is not a function

I can think of two possible options – although I am not been able to test either right now. Option 1 In theory the cleaner one, as you detect if the mediaelementplayer plugin has loaded itself in the jQuery namespace: <!–Change WordPress Audio Player Default Volume–> <script type=”text/javascript”> jQuery(document).ready(function ($) { if($.fn.mediaelementplayer) { $(“audio”).mediaelementplayer({ success: … Read more

Automatic jQuery accordion from header tags

You can use shortcode function to do this. function accordion_shortcode( $atts, $content = null ) { extract( shortcode_atts( array( ‘class’ => ‘accordion’, ), $atts ) ); return ‘<div class=”‘ . esc_attr($class) . ‘”>’ . $content . ‘</div>’; } add_shortcode( ‘accordion’, ‘accordion_shortcode’ ); In editor you wrap your content: [accordion] <h3>Headline 1</h3> <p>Content.. lorem ipsum</p> <h3>Headline … Read more

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