Get options in wordpress


<?php

// Admin Email
$admin_email = get_option(‘admin_email’);

// Site url
$site_url = get_site_url();
bloginfo(‘url’);
get_bloginfo();

//site_url()
The site_url() will always be the location where you can reach the site by tacking on /wp-admin on the end,
while home_url() would not reliably be this location.

//home_url()
The home_url() would be where you have set your homepage by setting General > Settings “Site Address (URL)” field.

//Get date format from wordpress settings
$date_format = get_option(‘date_format’);

//Get time format from wordpress settings
$time_format = get_option(‘time_format’);

//Get start of week from wordpress settings
$start_of_week = get_option(‘start_of_week’);

//Get timezone from wordpress settings
$timezone_string = get_option(‘timezone_string’);

//No of posts
$posts_per_page = get_option(‘posts_per_page’);

//Check Search Engine Visibility or not
$blog_public = get_option(‘blog_public’);

//Get thumbnail width & height
$thumbnail_size_w = get_option(‘thumbnail_size_w’);
$thumbnail_size_h = get_option(‘thumbnail_size_h’);

//Medium size
$medium_size_w = get_option(‘medium_size_w’);
$medium_size_h = get_option(‘medium_size_h’);

//Large size
$large_size_w = get_option(‘large_size_w’);
$large_size_h = get_option(‘large_size_h’);

?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s