Server side responsive with cookies

here is code which i done after searching over google with help of different website.

<script type="text/javascript">
		function setCookie(cname,cvalue,exdays)	{
			var d = new Date();
			d.setTime(d.getTime()+(exdays*24*60*60*1000));
			var expires = "expires="+d.toGMTString();
			document.cookie = cname+"="+cvalue+"; "+expires;
		}
		windowwidth = document.body.clientWidth;
		setCookie("wwidth",windowwidth,30);
		var user1=getCookie("wwidth");
		//alert('user1'+user1);
		</script>
		<?php $screenWidth = $_COOKIE['wwidth'] ?>

Condition php code

<?php if ($screenWidth <= 660) { ?>
		<div class="class1" id="content">
	<?php } else { ?>
		<div class="class2" id="content">
	<?php } ?>

How Separate First post from Other in wordpress loop

As wordpress freelancer i found way to first post from Other in wordpress loop. Below is php code for same.

$latest_post = new WP_Query("post_type=post&posts_per_page=5&orderby=date&order=DESC");
if ( $latest_post->have_posts() ) :  $i = 0; while ( $latest_post->have_posts() ) : $latest_post->the_post();
if ( $i == 0 ) { ?>
<!-- FIRST POST CODE WILL COME HERE -->
<?php }else{ ?>
<!-- Others POST CODE WILL COME HERE -->
<?php }  
$i++;  
endwhile;  
endif; 

jQuery Get every third/ specific level of element

Here is jquery code to third/ specific level of element

jQuery('#portfolioItem li:nth-child(3n+3)').css({ marginRight: '0px' });

How to get bbpress Topic author id and current user id

Here is code which will show you wordpress bbpress topic author ID and wordpress current user id.

<?php 
$author_id = get_the_author_meta('ID') ;
$currentuserID = bbp_get_current_user_id();
echo 'Author ID '. $author_id .'';
echo 'Current User Id' .$currentuserID.'';
 ?>

How to Create wordpresss breadcrumb without plugin

Here is code to show how you can create wordpress breadcrumb feature without installing any plugin.

Open your functions.php and paste the code below in it:

function the_breadcrumb() {
                echo '<ul id="crumbs">';
        if (!is_home()) {
                echo '<li><a href="';
                echo get_option('home');
                echo '">';
                echo 'Home';
                echo "</a></li>";
                if (is_category() || is_single()) {
                        echo '<li>';
                        the_category(' </li><li> ');
                        if (is_single()) {
                                echo "</li><li>";
                                the_title();
                                echo '</li>';
                        }
                } elseif (is_page()) {
                        echo '<li>';
                        echo the_title();
                        echo '</li>';
                }
        }
        elseif (is_tag()) {single_tag_title();}
        elseif (is_day()) {echo"<li>Archive for "; the_time('F jS, Y'); echo'</li>';}
        elseif (is_month()) {echo"<li>Archive for "; the_time('F, Y'); echo'</li>';}
        elseif (is_year()) {echo"<li>Archive for "; the_time('Y'); echo'</li>';}
        elseif (is_author()) {echo"<li>Author Archive"; echo'</li>';}
        elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "<li>Blog Archives"; echo'</li>';}
        elseif (is_search()) {echo"<li>Search Results"; echo'</li>';}
        echo '</ul>';
}

Once done, open header.php and call the function:

<?php the_breadcrumb(); ?>

How to add Custom field in custom portfolio type post

Here is solution to add custom field in your custom portfolio entries, for this you must activate the “custom fields” manually.
Open up portfolio.php OR php function where you registering post type “portfolio. portfolio_register() and search for:

'supports' => array('title','thumbnail','excerpt','editor','comments')

Replace it with

'supports' => array('title','thumbnail','excerpt','editor','comments','custom-fields')

How to check post or page has an attachment in wordpress

Here is code to check post or page has an attachment in wordpress. You have to in wordpress loop.

<?php
if ( is_attachment() ) {
	echo 'Has an Attachment';
} else {
	echo 'Not has an Attachment';
}
?>

How to Check the_content is empty in wordpress

Here is code to check the_content is or not empty in wordpress.

<?php 
 $content = get_the_content();
 if(trim($content) == "") {
 echo '<p>Empty Content</p>'
 } else {
 echo '<p>NOT Empty Content</p>';
} ?>

How to Get a Custom URL for Your Facebook Page in Five Easy Steps

Does your Facebook page’s URL look something like this?

www.facebook.com/My-Facebook-Page/303188632181849

By default, your Facebook page’s URL is made up of your page’s name plus a long number. If you want to put the URL on your business card, or spell it out over the phone, this is obviously not ideal.

The good news is that you can create a custom URL (sometimes called a “vanity URL”) with a username and no number, like this:

www.facebook.com/myfbpage

In the past, you needed 25 likes to do this, but you can now do this at any time – even when you’re setting up your page.

It only takes a couple of minutes to secure your custom URL, so do it today if at all possible: the longer you delay, the higher the chance that someone will take the username that you want!

1. Login to Facebook and go to your page. (You can find it in the left-hand column of your Facebook home page, under Pages.)

2. At the top of your admin panel, click “Edit page” and select “Update Page Info”, as shown in the screenshot below:

facebook page custom url

You’ll then see this at the top of the Page Info tab:

facebook page custom url

3. Under “Page Address”, click the “Enter a Facebook web address” link, then click the new link that appears – “Create a web address for this Page?”

4. Your page should be automatically selected from the drop-down menu. Enter the username you want and click “Check availability”. You’ll need to make sure your username fits Facebook’s guidelines.

facebook page custom url

5. Make sure you’re happy with your username (and double-check the spelling) before confirming it. Once you’re sure you’re happy, click “Confirm”.

facebook page custom url

And that’s it! You should see this confirmation message:

facebook page custom url

Your old URL will redirect to the new one, so you don’t need to worry about updating your previous links.

Have you had a custom Facebook page URL for ages, or did this post prompt you to get yours? Let us know in the comments.

How to Redirect User to a custom page after registration

Below is code to redirect User to a custom page after registration

function __my_registration_redirect(){
    return home_url( '/my-page' );
}
add_filter( 'registration_redirect', '__my_registration_redirect' );

Thanks TheDeadMedic for the tip!

how to extract number only for php variable

Here is code to extract number only for php variable

<?php $str = get_comment_author_url();
      $str1 = preg_match('/d+/', $str23);
      echo $str1;

How to stop showing wordpress Update notification message

Here is code to stop showing wordpress Update notification message.

Want to remove the nagging update notice from your WordPress site? Sometimes this can be helpful if you built the site for someone else and don’t want them upgrading it. Perhaps there are plugins running on the site that won’t be compatible with the update. Here’s a quick snippet to remove the notice from your site:

Just below code in your theme function.php file

add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );

Google Analytics for Android mobile

Google Analytics for Android mobile

Google Analytics for Android mobile

Here is Google Analytics Android mobile version for Web designer & web developer.

Access all of your Google Analytics web and app reporting profiles from your mobile device. The app has an all-new look and feel that’s optimized for phones and tablets, so you can easily get your Analytics data anytime, anywhere in mobile.

What’s New

* New visualizations that automatically resize to fit your screen size and orientation
* Gesture based navigation, ideal for tablets and phones
* Side navigation that mirrors Google Analytics on the web
* Supports reporting for web and app profiles
* An Overview screen summarizing key metrics from each report
* Deeper analysis via dimension-based drill down in most reports
* Better Real-Time reporting

Latest New WordPress 3.6 Features

WordPress co-founder Matt Mullenweg announced the release of the latest version WordPress 3.6 which has beed in honor of Canadian jazz pianist Oscar Peterson.

Latest New WordPress 3.6 include follwing Features

  • a beautiful new blog-centric theme  Twenty Thirteen theme,
  • bullet-proof autosave and post locking,
  • a revamped revision browser,
  • native support for audio and video embeds,
  • Improved integrations with Spotify, Rdio, and SoundCloud Read more →

How to Limit the size of the post excerpt in WordPress

Here is code to Limit the size of the post excerpt in WordPress.
Add below code into function.php it will set limit 20 charactor.

function custom_excerpt_length( $length ) {
	return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

How to display content to registered users only

Ever wanted to be able to show some content only to registered users in your blog posts? If yes, just read this recipe, which contains an awesome shortcode to do it!

here is code to  display content to registered users only

Just paste the following code on your functions.php file:

add_shortcode( 'member', 'member_check_shortcode' );

function member_check_shortcode( $atts, $content = null ) {
	 if ( is_user_logged_in() &amp;&amp; !is_null( $content ) &amp;&amp; !is_feed() )
		return $content;
	return '';
}

Once done, you can add the following to your posts to create a portion or text (or any other content) that will be only displayed to registered users:

[member]
This text will be only displayed to registered users.
[/member]

That’s all. Easy and useful!

Page 2 of 1212345...10...»

Wordpress Freelancer, Joomla Freelancer Web designer Mumbai india, Wordpress web developer India, Joomla Web developer india, Outsourcing web project india mumbai

By Santosh Kori Published: October 10, 2012 Professional Freelance Website developer 5 stars based on 65 reviews Total time: 24 hour 00 min Wordpress Joomla XHTML CSS jQuery HTML5 eCommerce CSS3 ☞ Offers low cost freelance web designing, asp php asp.net web development services from Mumbai India. Freelance web designer & developer Mumbai India.

I AM NOT AVAILABLE FOR WEB DESIGN & DEVELOPMENT PROJECTS