Wrap posts p tags in div

You need to add it to a JS file and then enqueue it in your functions.php jQuery(document).ready(function($){ $(‘p’).wrap(‘<div class=”post-txt” />’); }); If you already have a js file, you can add it to that file and you’re done. Else, save the above snippet in a new file. Put that file in a folder called js … Read more

How can I implement jQuery plugin correctly with my CPT?

It looks like you’re looping 4 <ul class=”flex-unslider-ul”> items, do you not need to simply put the loop around the <li class=”flex-unslider-slide”> <?php $args = array( ‘post_type’ => ‘referanse’ ); $referanser = new WP_Query( $args ); if( $referanser->have_posts() ): ?> <ul class=”flex-unslider-ul”> <?php while( $referanser->have_posts() ): $referanser->the_post(); ?> <li class=”flex-unslider-slide”> <div class=”content”> <?php the_content(); ?> … Read more

Using Jquery submit with ajax request

That error was identified by stackoverflow – it’s actually caused by Rapport software, a security tool some banks recommend. You could turn it off / remove it from development machines.

How to add external remote JS source to Gravity Forms?

I think you’re looking for gform_enqueue_scripts which is simply a Gravity Forms specific version of the wp_enqueue_scripts hook. Either hook uses the wp_enqueue_script() function. That function can take a local script—usually using get_template_directory_uri() (theme), get_stylesheet_directory_uri() child theme), or plugins_url() (plugin) to reference the file location—or an external location like what you’re trying to do. You’d … Read more

Fetching posts from wordpress function in ajax

If you read the documentation for locate_template you’ll see the problem. locate_template( $template_names, $load, $require_once ); $require_once (boolean) (optional) If true, the template file will be loaded with the php require_once function. If false, the template file will be loaded with the php require function. This parameter has no effect if $load is false. Default: … Read more

Save jQuery UI Sortable on WordPress

if you use the stop function when you intialise .sortable() you can ajax send the new order to a script, which (when you write it!) would save the new order to the database. jQuery(function(){ jQuery(“#sortable”).sortable({ stop: function (event, ui) { var new_order = jQuery(this).sortable(‘serialize’); jQuery.post( “http://www.thissite.com/wp-admin/ajax.php”, { action: my_custom_ajax_save, order: new_order }, function( data ) … Read more

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