Friday, January 23, 2015

php if condition/ PHP if else conditions

Developer help guide for PHP 


<head>

</head>

<body>

<!------ Conditions ----->

<?php
$d=date("D");
if ($d=="Fri")
  echo "Have a nice weather!"; 
else
  echo "Have a glorious day!"; 
?>



<?php
$d=date("D");
if ($d=="Fri")
  echo "Have a nice weather!"; 
else if ($d=="Mon")
echo "Have a nice monday!";
else
  echo "Have a glorious day!"; 
?>
</body>
</html>

wordpress latest jQuery call

This Code for WP latest jQuery cal

function sonia_arest_jquery() {
wp_enqueue_script('jquery');
}
add_action('init', 'sonia_arest_jquery');

This Code for wordpress Admin login header Call

befor </head>
<?php wp_head();?>


befor </body>
<?php wp_footer();?>

wordpress custom taxonomy register

wordpress custom taxonomy register

function sonia_taxonomy() {
register_taxonomy(
'portfolio_cat',  //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
'portfolio-items',                  //post type name
array(
'hierarchical'          => true,
'label'                         => 'Portfolio Category',  //Display name
'query_var'             => true,
'rewrite'                       => array(
'slug'                  => 'portfolio-category', // This controls the base slug that will display before each term
'with_front'    => true // Don't display the category base before
)
)
);
}
add_action( 'init', 'sonia_taxonomy');