Blog
Singleton entity, contains essential blog informations
Properties & methods
ID
Site ID
int
archive_link(post_type)
Post type archive link
string
archive_title(post_type)
Post type archive title
string
body_class
The class names for the body element
string
breadcrumb
Default navigational aid
array
charset
Displays the “Encoding for pages and feeds”
string
debug
Symfony debug mode
bool
description
Displays the “Tagline”
string
domain
Blog current domain
string
environment
Symfony environment
string
home_link(path)
URL for the current site
string
info(name)
Information about the current site
string
language
Language code for the current site ( ex : en-US )
string
language_attributes
HTML lang attribute ( ex : lang="en-US" )
string
languages
Return all available languages
array
locale
Locale code for the current site ( ex : en )
string
login_link(redirect)
Retrieves the login URL
string
maintenance_mode
Maintenance mode
bool
menu
object
meta
Get site meta
mixed
network_home_link(path)
Retrieves the home URL for the current network.
string
option(name)
Retrieves an option value based on an option name
string
options
Return option helper
object
paged
Current pagination offset for archive
int
pagination
Default archive pagination
array
posts(args, order, limit)
Perform a WP_Query, return PostCollection
object
posts_per_page
Default posts per page value
int
privacy_policy_link
The URL to the privacy policy page
string
privacy_policy_title
The title of the privacy policy page
string
queried_object
Return WP_Query queried object
mixed
search_link(query)
Retrieves the permalink for a search
string
terms(args, order, limit)
Perform a WP_Term_Query, return TermCollection
object
title
Page title for all areas of blog
string
user
object
users(args, order, limit)
Perform a WP_User_Query, return UserCollection
object
version
Version set in project composer.json
string
is_admin
Current user is an administrator
bool
is_archive
The query is for an existing archive page
array
is_customize_preview
The site is being previewed in the Customizer
bool
is_front_page
The query is for the front page of the site.
bool
is_single
The query is for an existing single post
bool
is_tax
The query is for an existing custom taxonomy archive page
bool
Examples
Usage of blog properties in layout.html.twig
Display breadcrumb
Display custom field
Get specific ACF Option page value see https://www.advancedcustomfields.com/resources/options-page/
Display meta
Metadata for a site see https://developer.wordpress.org/reference/functions/get_site_meta/
Display blog info
Information about the current site see https://developer.wordpress.org/reference/functions/get_bloginfo/
Display language selector
Return languages, using WPML or MSLS
Display menu
Return navigation entity
Display option
Retrieves an option value based on an option name. see https://developer.wordpress.org/reference/functions/get_option/
Query posts : $criteria=[], array $orderBy = null, $limit = null, $offset = null
Perform a WP_Query, return PostCollection see https://developer.wordpress.org/reference/classes/wp_query/ Please note that post query should be done in a controller
Query terms : $criteria=[], array $orderBy = null, $limit = null, $offset = null
Perform a WP_Term_Query, return TermCollection see https://developer.wordpress.org/reference/classes/WP_Term_Query/__construct/ Please note that term query should be done in a controller
Query users : $criteria=[], array $orderBy = null, $limit = null, $offset = null
Perform a WP_User_Query, return UserCollection see https://developer.wordpress.org/reference/classes/wp_user_query/ Please note that user query should be done in a controller
Last updated
Was this helpful?