WordPress at a glance
Главная Functions Theme (template)

Category: Theme (template)

Shortcodes

add_shortcode()

Adds a new shortcode.

do_shortcode()

Search content for shortcodes and filter shortcodes through their hooks.

gallery_shortcode()

Builds the Gallery shortcode output.

get_shortcode_regex()

Retrieve the shortcode regular expression for searching.

has_shortcode()

Whether the passed content contains the specified shortcode

remove_all_shortcodes()

Clear all shortcodes.

remove_shortcode()

Removes hook for shortcode.

shortcode_atts()

Combine user attributes with known attributes and fill in defaults when needed.

shortcode_exists()

Whether a registered shortcode exists named $tag

strip_shortcodes()

Remove all shortcode tags from the given content.

wp_audio_shortcode()

Builds the Audio shortcode output.

wp_playlist_shortcode()

Builds the Playlist shortcode output.

wp_video_shortcode()

Builds the Video shortcode output.

Other Theme Functions

add_theme_support()

Registers theme support for a given feature.

bloginfo()

Displays information about the current site.

body_class()

Display the classes for the body element.

current_theme_supports()

Checks a theme's support for a given feature

get_custom_header_markup()

Retrieve the markup for a custom header.

get_custom_logo()

Returns a custom logo, linked to home.

get_header_image()

Retrieve header image for custom header.

get_header_image_tag()

Create image tag markup for a custom header image.

get_header_textcolor()

Retrieves the custom header text color in 3- or 6-digit hexadecimal form.

get_header_video_url()

Retrieve header video URL for custom header.

get_page_templates()

Get the Page Templates available in this theme

get_post_class()

Retrieves the classes for the post div as an array.

get_query_template()

Retrieve path to a template

get_stylesheet()

Retrieve name of the current stylesheet.

get_template()

Retrieve name of the current theme.

get_theme_mod()

Retrieve theme modification value for the current theme.

get_theme_mods()

Retrieve all theme modifications.

get_theme_root()

Retrieve path to themes directory.

has_custom_logo()

Determines whether the site has a custom logo.

has_header_image()

Check whether a header image is set or not.

has_header_video()

Check whether a header video is set or not.

is_child_theme()

Whether a child theme is in use.

is_header_video_active()

Checks whether the custom header video is eligible to show on the current page.

is_multi_author()

Does this site have more than one author

post_class()

Display the classes for the post div.

register_nav_menu()

Registers a navigation menu location for a theme.

register_nav_menus()

Registers navigation menu locations for a theme.

register_theme_directory()

Register a directory that can contain themes.

remove_theme_mod()

Remove theme modification name from current theme list.

remove_theme_mods()

Remove theme modifications option for current theme.

remove_theme_support()

Allows a theme to de-register its support of a certain feature

search_theme_directories()

Search all registered theme directories for complete and valid themes.

set_theme_mod()

Update theme modification value for the current theme.

single_month_title()

Display or retrieve page title for post archive based on date.

the_custom_header_markup()

Print the markup for a custom header.

the_custom_logo()

Displays a custom logo, linked to home.

the_header_video_url()

Display header video URL.

the_search_query()

Displays the contents of the search query variable.

unregister_nav_menu()

Unregisters a navigation menu location for a theme.

wp_custom_css_cb()

Render the Custom CSS style element.

wp_dequeue_style()

Remove a previously enqueued CSS stylesheet.

wp_deregister_style()

Remove a registered stylesheet.

wp_footer()

Fire the wp_footer action.

wp_get_archives()

Display archive links based on type and format.

wp_get_document_title()

Returns document title for the current page.

wp_get_theme()

Gets a WP_Theme object for a theme.

wp_get_themes()

Returns an array of WP_Theme objects based on the arguments.

wp_head()

Fire the wp_head action.

wp_is_mobile()

Test if the current browser runs on a mobile device (smart phone, tablet, etc.)

wp_nav_menu()

Displays a navigation menu.

wp_site_icon()

Display site icon meta tags.

wp_title()

Display or retrieve page title for all areas of blog.

Theme files connection

comments_template()

Load the comment template specified in $file.

get_footer()

Load footer template.

get_header()

Load header template.

get_parent_theme_file_path()

Retrieves the path of a file in the parent theme.

get_search_form()

Display search form.

get_sidebar()

Load sidebar template.

get_stylesheet_directory()

Retrieve stylesheet directory path for current theme.

get_stylesheet_directory_uri()

Retrieve stylesheet directory URI.

get_stylesheet_uri()

Retrieves the URI of current theme stylesheet.

get_template_directory()

Retrieve current theme directory.

get_template_directory_uri()

Retrieve theme directory URI.

get_template_part()

Loads a template part into a template.

get_theme_file_path()

Gets the path to the specified theme file. Work with child themes.

get_theme_file_uri()

Retrieves the URL of a file in the theme.

get_theme_root_uri()

Retrieve URI for themes directory.

is_page_template()

Whether currently in a page template.

load_template()

Require the template file with WordPress environment.

locate_template()

Retrieve the name of the highest priority template file that exists.

Widgets (sidebars)

dynamic_sidebar()

Display dynamic sidebar.

is_active_sidebar()

Whether a sidebar is in use.

is_active_widget()

Whether widget is displayed on the front end.

is_dynamic_sidebar()

Whether the dynamic sidebar is enabled and used by theme.

is_registered_sidebar()

Checks if a sidebar is registered.

register_sidebar()

Builds the definition for a single sidebar and returns the ID.

register_sidebars()

Creates multiple sidebars.

register_widget()

Register a widget Registers a WP_Widget widget

the_widget()

Output an arbitrary widget as a template tag.

unregister_sidebar()

Removes a sidebar from the list.

unregister_widget()

Unregisters a widget.

wp_get_sidebars_widgets()

Retrieve full list of sidebars and their widget instance IDs.

wp_register_sidebar_widget()

Register an instance of a widget.

wp_register_widget_control()

Registers widget control callback for customizing options.

wp_unregister_sidebar_widget()

Remove widget from sidebar.

Menu

get_nav_menu_locations()

{{desc}}

get_the_posts_navigation()

Returns the navigation to next/previous set of posts, when applicable.

has_nav_menu()

Determines whether a registered nav menu location has a menu assigned to it.

the_posts_navigation()

Displays the navigation to next/previous set of posts, when applicable.

wp_get_nav_menu_items()

Retrieves all menu items of a navigation menu.

wp_get_nav_menu_name()

Returns the name of a navigation menu.

wp_get_nav_menu_object()

Returns a navigation menu object.

wp_get_nav_menus()

Returns all navigation menu objects.

Archives

get_next_posts_link()

Retrieves the next posts page link.

get_pagenum_link()

Retrieves the link for a page number.

get_posts_nav_link()

Retrieves the post pages link navigation for previous and next pages.

get_previous_posts_link()

Retrieves the previous posts page link.

get_the_archive_description()

Retrieves the description for an author, post type, or term archive.

get_the_archive_title()

Retrieve the archive title based on the queried object.

get_the_posts_pagination()

Retrieves a paginated navigation to next/previous set of posts, when applicable.

get_year_link()

Retrieves the permalink for the year archives.

next_posts_link()

Displays the next posts page link.

paginate_links()

Retrieve paginated link for archive post pages.

posts_nav_link()

Displays the post pages link navigation for previous and next pages.

previous_posts_link()

Displays the previous posts page link.

the_archive_description()

Display category, tag, term, or author description.

the_archive_title()

Display the archive title based on the queried object.

the_posts_pagination()

Displays a paginated navigation to next/previous set of posts, when applicable.

Settings (customizer)

has_custom_header()

Check whether a custom header is set or not.

is_customize_preview()

Checks whether the site is being previewed in the WordPress Customizer (the visual theme settings page). Conditional tag.

wp_get_custom_css()

Fetch the saved Custom CSS content for rendering.