<?php
function getCurrentCatID(){
global $wp_query;
if(is_category() || is_single()){
$cat_ID = get_query_var(‘cat’);
}
return $cat_ID;
}
echo $getCurrentCatID();
?>
<?php
function getCurrentCatID(){
global $wp_query;
if(is_category() || is_single()){
$cat_ID = get_query_var(‘cat’);
}
return $cat_ID;
}
echo $getCurrentCatID();
?>
<?php
$content = get_the_content();
echo substr(strip_tags($content), 0, 100);
?>
<?php
foreach((get_the_category(POST-ID)) as $category) {
echo $category->cat_name;
}
?>
The below given code will list all the values added to the given fields
<?php
$custom_fields = get_post_custom(POST_ID);
$fieldsValue = $custom_fields[‘FIELD’];
foreach ( $fieldsValue as $key => $value )
echo $value . “<br />”;
?>
<script language=”javascript” type=”text/javascript”>
function myFunction() {
}
if(window.myFunction) {
alert(“‘myFunction’ already exists”);
} else {
alert(“‘myFunction’ does not already exists”);
}
</script>
<?php
mysql_list_dbs();
Example :
$connection=mysql_connect(“localhost”,”root”,”password”);
$dataBases = mysql_list_dbs($connection);
while ($db = mysql_fetch_object($dataBases)) {
echo $db->Database . “<br />”;
}
?>
<?php
mysql_affected_rows();
?>
<?php
if ( class_exists( “class-name” ) ) {
echo “Exists”;
}
?>
<?php
mysql_close();
?>
<?php
mysql_select_db (DB-NAME)
?>