Monthly Archives: January 2012

Vote now for your favorite CMS

Stop contact form 7 from conflicting with your other jquery based code on wordpress

To stop the contact form 7 from conflicting with other jquery based code and plugins you can use this code in the functions.php file.

// De-register jQuery from Contact Form 7

add_action( ‘wp_print_scripts’, ‘my_deregister_javascript’, 100 );
function my_deregister_javascript() {
wp_deregister_script( ‘contact-form-7’ );
}

found the solution here

Pagination for custom WordPress Posts

This is something that should be really easy, and should be automatic but as I ran into some problems with this I’m posting the way I did it here,

First I got the pagination plugin WP-PageNav and installed it.

Then in my custom post Query added following highlighted part,

$loop = new WP_Query(array(‘category_name’ => ‘news’, ‘posts_per_page’ => 10, ‘paged’ => $paged));

then after the end while of the wp loop I added the following code to add navigation,

<?php

if(function_exists(‘wp_pagenavi’)) {
echo¬†¬† wp_pagenavi( array( ‘query’ =>$loop ));
}
?>

 

 

Hope this helps.