[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-content/themes/twentyeleven/ -> functions.php (summary)

Twenty Eleven functions and definitions Sets up the theme and provides some helper functions. Some helper functions are used in the theme as custom template tags. Others are attached to action and filter hooks in WordPress to change core functionality.

File Size: 927 lines (30 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 23 functions

  twentyeleven_setup()
  twentyeleven_scripts_styles()
  twentyeleven_block_editor_styles()
  twentyeleven_header_style()
  twentyeleven_admin_header_style()
  twentyeleven_admin_header_image()
  twentyeleven_excerpt_length()
  twentyeleven_continue_reading_link()
  twentyeleven_auto_excerpt_more()
  twentyeleven_custom_excerpt_more()
  twentyeleven_page_menu_args()
  twentyeleven_widgets_init()
  twentyeleven_content_nav()
  twentyeleven_get_first_url()
  twentyeleven_url_grabber()
  twentyeleven_footer_sidebar_class()
  twentyeleven_comment()
  twentyeleven_posted_on()
  twentyeleven_body_classes()
  twentyeleven_get_gallery_images()
  twentyeleven_widget_tag_cloud_args()
  wp_body_open()
  twentyeleven_skip_link()

Functions
Functions that are not part of a class:

twentyeleven_setup()   X-Ref
Set up theme defaults and registers support for various WordPress features.

Note that this function is hooked into the after_setup_theme hook, which runs
before the init hook. The init hook is too late for some features, such as indicating
support post thumbnails.

To override twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme's
functions.php file.


twentyeleven_scripts_styles()   X-Ref
Enqueue scripts and styles for front end.


twentyeleven_block_editor_styles()   X-Ref
Enqueue styles for the block-based editor.


twentyeleven_header_style()   X-Ref
Styles the header image and text displayed on the blog.


twentyeleven_admin_header_style()   X-Ref
Styles the header image displayed on the Appearance > Header admin panel.

Referenced via add_theme_support('custom-header') in twentyeleven_setup().


twentyeleven_admin_header_image()   X-Ref
Custom header image markup displayed on the Appearance > Header admin panel.

Referenced via add_theme_support('custom-header') in twentyeleven_setup().


twentyeleven_excerpt_length( $length )   X-Ref
Set the post excerpt length to 40 words.

To override this length in a child theme, remove
the filter and add your own function tied to
the excerpt_length filter hook.

param: int $length The number of excerpt characters.
return: int The filtered number of characters.

twentyeleven_continue_reading_link()   X-Ref
Return a "Continue Reading" link for excerpts

return: string The "Continue Reading" HTML link.

twentyeleven_auto_excerpt_more( $more )   X-Ref
Replace "[...]" in the Read More link with an ellipsis.

The "[...]" is appended to automatically generated excerpts.

To override this in a child theme, remove the filter and add your own
function tied to the excerpt_more filter hook.

param: string $more The Read More text.
return: The filtered Read More text.

twentyeleven_custom_excerpt_more( $output )   X-Ref
Add a pretty "Continue Reading" link to custom post excerpts.

To override this link in a child theme, remove the filter and add your own
function tied to the get_the_excerpt filter hook.

param: string $output The "Continue Reading" link.
return: string The filtered "Continue Reading" link.

twentyeleven_page_menu_args( $args )   X-Ref
Show a home link for the wp_nav_menu() fallback, wp_page_menu().

param: array $args The page menu arguments. @see wp_page_menu()
return: array The filtered page menu arguments.

twentyeleven_widgets_init()   X-Ref
Register sidebars and widgetized areas.

Also register the default Epherma widget.


twentyeleven_content_nav( $html_id )   X-Ref
Display navigation to next/previous pages when applicable.

param: string $html_id The HTML id attribute.

twentyeleven_get_first_url()   X-Ref
Return the first link from the post content. If none found, the
post permalink is used as a fallback.

return: string The first link.

twentyeleven_url_grabber()   X-Ref
Return the URL for the first link found in the post content.

return: string|bool URL or false when no link is present.

twentyeleven_footer_sidebar_class()   X-Ref
Count the number of footer sidebars to enable dynamic classes for the footer.


twentyeleven_comment( $comment, $args, $depth )   X-Ref
Template for comments and pingbacks.

To override this walker in a child theme without modifying the comments template
simply create your own twentyeleven_comment(), and that function will be used instead.

Used as a callback by wp_list_comments() for displaying the comments.

param: object $comment The comment object.
param: array  $args    An array of comment arguments. @see get_comment_reply_link()
param: int    $depth   The depth of the comment.

twentyeleven_posted_on()   X-Ref
Print HTML with meta information for the current post-date/time and author.

Create your own twentyeleven_posted_on to override in a child theme


twentyeleven_body_classes( $classes )   X-Ref
Add two classes to the array of body classes.

The first is if the site has only had one author with published posts.
The second is if a singular post being displayed

param: array $classes Existing body classes.
return: array The filtered array of body classes.

twentyeleven_get_gallery_images()   X-Ref
Retrieve the IDs for images in a gallery.

return: array List of image IDs from the post gallery.

twentyeleven_widget_tag_cloud_args( $args )   X-Ref
Modifies tag cloud widget arguments to display all tags in the same font size
and use list format for better accessibility.

param: array $args Arguments for tag cloud widget.
return: array The filtered arguments for tag cloud widget.

wp_body_open()   X-Ref
Fire the wp_body_open action.

Added for backwards compatibility to support pre 5.2.0 WordPress versions.


twentyeleven_skip_link()   X-Ref
Include a skip to content link at the top of the page so that users can bypass the menu.




Generated: Tue Oct 22 08:20:01 2019 Cross-referenced by PHPXref 0.7