Conditional custom fields WordPress

This item was filled under [ PHP, Wordpress ]
Your Ad Here

Sometimes we need to implement some custom field values with a condition. Example, if i need to show an image in the index page and all post does not an image, then we can use the conditional custom fields.

Here is the code:

<?php
$myimage = get_post_meta($post->ID, ‘image’, true);
if ($myimage == ‘ ‘)
{ ?>
<?php the_excerpt(); ?>
<?php } else { ?>
<a href=”<?php the_permalink(); ?>”><img src=”<?php echo $myimage; ?>” class=”alignleft” /></a>
<?php the_excerpt(); ?>
<?php } ?>

Enjoy

How to use @font-face in css

This item was filled under [ CSS, CSS3 ]
Your Ad Here

@font-face is a CSS3 rule, which allows you to show a font on a web page even if that font is not installed on the user’s computer. In css3 there are many options to beautify a website. @font-face is one of that. In this you can embed custom fonts to the css in different formats for different browsers.

Here is how to implement @font-face

@font-face {
font-family: “your font name” ;
src: url(“your-font.ttf”) ; /* for mozilla, chrome, opera and safari */
src: url(“your-font.eot”) ; /* for IE */
src: url(“your-font.otf”) ; /* mozilla and safari*/
}

Continue reading…

960 Grid System video tutorial

This item was filled under [ CSS ]
Your Ad Here

Continue reading…

How to change the Language of PHPMyadmin

This item was filled under [ PHP ]
Your Ad Here

It is simple

just go to xampp>phpMyAdmin and open config.inc.php

then add this to the code ” $cfg['Lang']     = ’en-utf-8′;  ” (without quotes)

 

enjoy :)

How to call a function in parent window from child window

This item was filled under [ Javascript, PHP ]
Your Ad Here


Popup windows(like thickbox)  are an important thing in the case of web development. Some times we need to call an ajax function which is in the parent window.Here is the method for calling javascript function in the parent window from child window.Place a function to close the thickbox ,in that function place this code
Continue reading…

Image resize library for codeigniter

This item was filled under [ PHP ]
Your Ad Here


I got a good image re size code from googling.I convert the code to a codeigniter library.

How to use this library

1) Initialise / load image
2) Resize image (options: exact, portrait, landscape, auto, crop)

  • Resize by exact width/height. (exact)
  • Resize by width – exact width will be set, height will be adjusted according to aspect ratio. (landscape)
  • Resize by height – like Resize by Width, but the height will be set and width adjusted dynamically. (portrait)
  • Auto determine options 2 and 3. If you’re looping through a folder with different size photos, let the script determine how to handle this. (auto)
  • Resize, then crop. This is my favourite. Exact size, no distortion. (crop)

3) Save image

Continue reading…

Mouseover fade effect using jQuery

This item was filled under [ jQuery ]
Your Ad Here


We can increase user interaction with our site using mouse over fade effect.Interactivity is the soul of a site.Once we apply fade effect with tab menus, directly communicate with user.We can also apply css with this fade effect that will make our site more attractive. This collection of my handpicked amazing jQuery Hover effect plugins  will help you bring great interactivity.

use this scripts
 Continue reading...

How to make rounded corner div using css

This item was filled under [ CSS ]
Your Ad Here

In many sites we found rounded corner divs without using images. We can make it in simple way using css. But it will not work in IE up to IE 8. We can use this css on everything, like table, text inputs, buttons, images, etc.

for deferent browsers, the css are,

IE9+ = border-radius: Value;

Mozilla Firefox = -moz-border-radius: Value;

Opera = -o-border-radius: Value;

Crome, safari = -webkit-border-radius: Value;

Konqueror = -khtml-border-radius: Value;

Radius value 10px.

Here is the example for radius value 10px applied for a div

Continue reading…

Expand Collapse div using simple jquery

This item was filled under [ jQuery ]
Your Ad Here

Here you can easily create jQuery expand div. At first u need to create a html page and write css for the expand div. Watch the Documentation for integrating the jQuery expanding plugin below.

Collapsed

Expanded

Continue reading…

How to make Twitter type textfield glow effect using CSS

This item was filled under [ CSS ]
Your Ad Here


Twitter have good attractive interface to impress the users. one of them is the textfield. Here I am talking about how we can create that thing.

Its is simple. We can make it using CSS. There used some simple css steps.

But it will not work in explorer. The new version of explorer(IE 9) supports this.

Continue reading…