Monthly Archives: May 2010

Exclude post from wordpress loop

We just need to use post_not_in parameter in query posts $args = array( ‘post__not_in’ => array($post->ID) ); $the_query = new WP_Query($args);

Posted in WordPress | Tagged | 1 Comment

WordPress show other posts in category on story page(single.php)

ID); foreach($category_ids as $cat_id) { $category_id .= $cat_id->term_id . ‘, ‘; } $category_id = substr(trim($category_id), 0, -1); $args = array( ‘cat’ => $category_id, ‘orderby’=>’ID’, ‘order’ => ‘DESC’, ‘posts_per_page’ => 5, ‘post__not_in’ => array($post->ID) ); $the_query = new WP_Query($args); if ($the_query->have_posts()) … Continue reading

Posted in WordPress | Tagged | Leave a comment

Javascript Error: submit is not a function

If we have any button name with submit or with id submit.Then javascript form.submit will not work. Let’s say i have a input text box <input type=”submit” name=”submit” value=”Submit”> and i want to submit my form through document.formname.submit(); then it … Continue reading

Posted in Javascript | Tagged | Leave a comment

Basic command in linux

mkdir – make directories mkdir DIRECTORY_NAME cd – change directories Use cd to change directories. Type cd followed by the name of a directory to access that directory.Keep in mind that you are always in a directory and can navigate … Continue reading

Posted in Ubuntu | Tagged , | Leave a comment

Include ajax in wordpress using jquery?

To include ajax in wordpress plugin:- for eg. if we want to use ajax on click of some event <div id=”ajaxid” onclick=”testfn(1)” /> <script type=”text/javascript”> function testfn(val) { jQuery.ajax({ type: “post”,url: “admin-ajax.php”,data: { action: ‘save_data’, val: val}, success: function(html){ //so, … Continue reading

Posted in jquery, WordPress | Tagged , , | 1 Comment

google virtual keyboard positioning in IE

IE 7/8 the google virtual  keyboard box seems to get locked after a certain height.  I can move the keyboard anywhere above this line, but not below it. I found a soln and it really worked for me. In the … Continue reading

Posted in css | Tagged , , | 1 Comment

server commands

To chk total number of connection on a web server:- netstat  -ant | grep 80 | grep EST| wc -l To chk Memory usage ps -ylC httpd –sort:rss To chk free memory free

Posted in Ubuntu | Tagged , | Leave a comment