Monthly archive for January 2010

Removing The Title Attribute From wp_list_categories & wp_list_pages

January 23, 2010 | Filed Under Wordpress | 4 Comments

Use  Exact Below code for  categories  and pages.

wp_list_categories:

<?php $title_free_cats = wp_list_categories(‘echo=0′);

$title_free_cats = preg_replace(‘/title=\”(.*?)\”/’,,$title_free_cats);

echo $title_free_cats; ?>


wp_list_pages:

<?php $title_free_pages = wp_list_pages(‘echo=0′); $title_free_pages = preg_replace(‘/title=\”(.*?)\”/’,,$title_free_pages); echo $title_free_pages; ?>

Article written by admin

Exclude category from RSS feed in wordpress

January 22, 2010 | Filed Under Wordpress | 3 Comments

To exclude category in wordpress rss feed.

you can simple write.

<a href="<?php bloginfo('url'); ?>/feed?cat=-1&cat=-2">(RSS)</a>

or you can simple  write below code in your theme function.php
to exclude category categories.


function excludeCat($query) {
 if ($query->is_feed) {
 $query->set('cat','-1');// for multiple use with , eg-  -1,-2,-3
 }
return $query;
 }
add_filter('pre_get_posts','excludeCat');
Article written by admin

Enable session in wordpress

January 22, 2010 | Filed Under Wordpress | Leave a Comment

wordpress does not provide the facility to enable session into wordpress.
but for enable session in wordpress you need to add

add_action(‘init’, ’sessionStart’));

function sessionStart()
{
if ( ! session_id())
session_start();
}

code in your theme  function.php.

But you must installed exec-php plugin to enable php code.

Article written by admin

How we can apply css in multiple Selectors in jquery.

January 20, 2010 | Filed Under JQuery | Leave a Comment

Here is example to demonstrate

$(”div,span,p.myClass”).css(”border”,”1px solid green”);

the border will be apply in all div,span ,p.myClass class element.

Article written by admin

How we can modify the css class in jquery.

January 20, 2010 | Filed Under JQuery | Leave a Comment

Using css method we can modify class using jquery

example:$(”.CssClass1.CssClass2″).css(”border”,”1px solid green”);

CssClass1,CssClass2 will be modify to border 1px solid green.

Article written by admin

How can we apply css in div using jquery.

January 20, 2010 | Filed Under JQuery | Leave a Comment

using css() method we can apply css in div element.
example:
$(”div”).css(”border”,”1px solid green”);

Article written by admin

get the value of selected option in jquery

January 20, 2010 | Filed Under JQuery | Leave a Comment

suppose that below is the  selectbox/combobox

<select id="sel">
   <option value="1">Hi</option>
   <option value="2">Hello</option>
   <option value="3">Helloooooo</option>
   <option value="4">ok</option>
   <option value="5">Okey</option>
 </select>

want to get  the  value of selected option, then use
 $("select#sel").val();

or get the text of selected box, then use
$("#seloption:selected").text();

Example
Article written by admin

check/uncheck an input in jquery?

January 20, 2010 | Filed Under JQuery | Leave a Comment

Using two function, we can perform the operation.

// Check #x
$(”#checkboxid”).attr(”checked”, “checked”);
// Uncheck #x
$(”#checkboxid”).removeAttr(”checked”);

Example

Article written by admin

disable/enable an element in jquery?

January 20, 2010 | Filed Under JQuery | Leave a Comment

you can disable/enable web element using attr and removeAttr functions respectively

// Disable #x
$(”#x”).attr(”disabled”,”disabled”);
// Enable #x
$(”#x”).removeAttr(”disabled”);

Example:

Article written by admin

How do I determine the state of a toggled element?

January 20, 2010 | Filed Under JQuery | Leave a Comment

Here is the example of toggled element using the :visible or :hidden selectors.

var vis = $(’#formdiv’).is(’:visible’);
var hide= $(’#formdiv’).is(’:hidden’);
If you want to show a div visibility, then there is example for this
For example:

$(’#formdiv:visible’).animate({left: ‘+=100px’}, ’slow’);

Article written by admin

© PHPInterviewQuestion.com 2009 - 2010

eXTReMe Tracker