Friday, September 27, 2013

PHP Function Reference/is page

<?php if(is_page(9)): ?> itemscope="" itemtype="http://schema.org/Physician" <?php endif; ?>

 -----------------
 <?php is_page($page); ?>
 -----------------

is_page();
// When any single Page is being displayed.

is_page( 42 );
// When Page 42 (ID) is being displayed.

is_page( 'Contact' );
// When the Page with a post_title of "Contact" is being displayed.

is_page( 'about-me' );
// When the Page with a post_name (slug) of "about-me" is being displayed.

is_page( array( 42, 'about-me', 'Contact' ) );
// Returns true when the Pages displayed is either post ID 42, or post_name "about-me", or post_title "Contact".  Note: the array ability was added at Version 2.5.

Tuesday, September 24, 2013

Contact Form 7 - Locating Response Message Box Anywhere

After a visitor of your blog submits the contact form, the visitor sees a response message from Contact Form 7, such as “Your message was sent successfully” or “Validation errors occurred.” I sometimes hear from users who tell me that the position of the response message is not good, and, in fact, sometimes their visitors miss the message entirely.

The response message is shown at the bottom of the form by default. You can change the location by putting a response message placeholder [response] inside the form. You can insert this [response] tag into any place of your choice. You can use it multiple times in a form. The response message will be shown within the placeholder after submission.

Wednesday, September 18, 2013

Redirect 404 error page to Home on WordPress

Add below 2 lines on 404.php file 

<?php
 header("Status: 301 Moved Permanently");
 header("Location: /");

?>

Media Queries Tutorial - Responsive Website

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
This will take control of the layout on mobile browsers. Place this inside the tag and you’re ready to go.

-------------------------------------------------------------------------------------------------------------------------------

Working < 960 Viewport

This is our first media query that will target screens less than 960px.
/* VIEWPORT < 960px */
@media only screen and (max-width: 960px){
#container{ width: 768px; }
}
Since our layout is now less than 960px, we will style all the main container elements by changing the width to 768px.

-------------------------------------------------------------------------------------------------------------------------------

Working < 768 Viewport

The above CSS is our second media query that will target screens less than 768px (Tablet Portrait).
/* VIEWPORT < 768px */
@media only screen and (max-width: 768px){
#container{ width: 524px; }
}

-------------------------------------------------------------------------------------------------------------------------------

Working < 524 Viewport

This is our third media query that will target screens less than 524px (Mobile).
@media only screen and (max-width: 524px){
#container{ width: 300px; }
}

-------------------------------------------------------------------------------------------------------------------------------

That's it...

For more detailed info: http://www.1stwebdesigner.com/css/media-queries-tutorial-convert-burnstudio-responsive-website/