<?php
bloginfo('description');
// Site description
?>
Tag Archives: PHP
How to get the charset used in the wordpress site
<?php
echo bloginfo('charset');
// Site charset
?>
How to get the vesrion of wordpress
<?php echo bloginfo('version'); // WordPress version ?>Or else load the page wp-includes > version.php and find ot the following line:$wp_version = '2.8.4';
How to get the text direction in the wordpress site
<?php
bloginfo('text_direction');
// Text Direction
?>
How to get the language used in the wordpress site
<?php
bloginfo('language');
// Site language
?>
How to get the email address of the site admin – WordPress
<?php
bloginfo('admin_email');
// admin email
?>
How to get the theme url – WordPress
<?php
bloginfo('stylesheet_directory');
// Theme path
?>
Remove spaces from the beginning and end of a string – PHP
<?php
echo trim(" Test "); // Test
//Will remove the spaces from the beginning and end
?>
Function that displays the categories – WordPress
<?php wp_list_categories(); // List all categories ?>
How to read all the keys or a subset of the keys of an array – PHP
<?php $testArray = array(1 => 5, "name" => "First Name"); print_r(array_keys($testArray)); //Array ( [0] => 1 [1] => name ) ?>