If you ever wonder how to access your WordPress blog information, this is the right article for you to read. In general, binders give the power to access information from the database with just a few lines of code.
The binder {{bloginfo}} allows you to access general blog information such as blog name, tagline, date format am other global settings.
Parameters
assign_to
The object to which you wish to assign the fetched data (blog information). By default, the response will include the following information:
- admin_email
- date_format
- blog_name
- blog_description
- blog_url
- posts_per_page
- template_directory_uri
- url
raw_data
Include all available blog information in the response.
- siteurl
- home
- blogname
- blogdescription
- users_can_register
- admin_email
- start_of_week
- use_balanceTags
- use_smilies
- require_name_email
- comments_notify
- posts_per_rss
- rss_use_excerpt
- mailserver_url
- mailserver_login
- mailserver_pass
- mailserver_port
- default_category
- default_comment_status
- default_ping_status
- default_pingback_flag
- posts_per_page
- date_format
- time_format
- links_updated_date_format
- comment_moderation
- moderation_notify
- permalink_structure
- gzipcompression
- hack_file
- blog_charset
- moderation_keys
- active_plugins
- category_base
- ping_sites
- advanced_edit
- comment_max_links
- gmt_offset
- default_email_category
- recently_edited
- template
- stylesheet
- comment_whitelist
- blacklist_keys
- comment_registration
- html_type
- use_trackback
- default_role
- db_version
- uploads_use_yearmonth_folders
- upload_path
- blog_public
- default_link_category
- show_on_front
- tag_base
- show_avatars
- avatar_rating
- upload_url_path
- thumbnail_size_w
- thumbnail_size_h
- thumbnail_crop
- medium_size_w
- medium_size_h
- avatar_default
- large_size_w
- large_size_h
- image_default_link_type
- image_default_size
- image_default_align
- close_comments_for_old_posts
- close_comments_days_old
- thread_comments
- thread_comments_depth
- page_comments
- comments_per_page
- default_comments_page
- comment_order
- sticky_posts
- widget_categories
- widget_text
- widget_rss
- uninstall_plugins
- timezone_string
- page_for_posts
- page_on_front
- default_post_format
- link_manager_enabled
- initial_db_version
- wp_user_roles
- widget_search
- widget_recent-posts
- widget_recent-comments
- widget_archives
- widget_meta
- sidebars_widgets
- cron
- auth_key
- auth_salt
- logged_in_key
- logged_in_salt
- nonce_key
- nonce_salt
- can_compress_scripts
- recently_activated
- theme_mods_twentyfourteen
- current_theme
- theme_mods_appcropolis
- theme_switched
- category_children
- nav_menu_options
- rewrite_rules
- template_directory_uri
Return
array (size=8)
'admin_email' => string 'sanraul@appcropolis.com' (length=23)
'blog_description' => string 'Appcropolis Builder' (length=19)
'blog_name' => string 'Builder' (length=7)
'date_format' => string 'F j, Y' (length=6)
'posts_per_page' => string '100' (length=3)
'blog_url' => string 'http://localhost:8888/wp' (length=24)
'url' => string 'http://builder.simplifysites.com' (length=32)
'template_directory_uri' => string 'http://your_project.simplifysites.com/sites/your_project/wp/wp-content/themes/appcropolis' (length=79)
Examples
Print basic blog information
<div>
{{bloginfo assign_to="info"}}
{{dump var="info"}}
</div>
The output of this request will look like this:
array (size=8)
'admin_email' => string 'sanraul@appcropolis.com' (length=23)
'blog_description' => string 'Appcropolis Builder' (length=19)
'blog_name' => string 'Builder' (length=7)
'date_format' => string 'F j, Y' (length=6)
'posts_per_page' => string '100' (length=3)
'blog_url' => string 'http://localhost:8888/wp' (length=24)
'url' => string 'http://builder.simplifysites.com' (length=32)
'template_directory_uri' => string 'http://your_project.simplifysites.com/sites/your_project/wp/wp-content/themes/appcropolis' (length=79)
Get all available blog information
<div>
{{bloginfo raw_data="true" assign_to="info"}}
{{dump var="info"}}
</div>