Volatyl Filters List

Chances are, you’ve seen the Volatyl Filters Guide and you want to know how the Volatyl filters use that information.

Every filter you see listed below has a description and code example that is ready to be used on your website.

Remember, we only work inside of child themes. Paste the code examples into the functions.php of your child theme.

Navigation

Pagination Placepagination_place

Controls static text before the pagination links. In the basic pagination example “Page 5 of 8 « ‹ 4 5 6 › »”, this filter can change “Page 5 of 8.”

Show me an example!

// Change pagination place text
function pagination_place_text( $variable ) {
    $search = array( 'Page', 'of' ); // Looking for?
    $replace = array( 'Article', 'out of' ); // Replacing with?
    $variable = str_replace( $search, $replace, $variable ); // Do it.
    return $variable; 
}
add_filter( 'pagination_place', 'pagination_place_text' );

Pagination Navigationpagination_navigation

Controls static text (excluding page numbers) for pagination. In the basic example “Page 5 of 8 « ‹ 4 5 6 › »”, this filter can change “«,” “‹,” “›,” and “».”

Show me an example!

// Change pagination navigation
function pagination_nav_text( $variable ) {
	$search = array( '«', '‹', '›', '»' );
	$replace = array( 'First', 'Previous', 'Next', 'Last' );
	$variable = str_replace( $search, $replace, $variable );
	return $variable;
}
add_filter( 'pagination_navigation', 'pagination_nav_text' );

Pagination Rangepagination_range

By default, pagination at its fullest will display your current page with links to the two preceding pages and the next two pages (five pages total). This filter should be a number which represents how many page links to display in either direction.

Show me an example!

// Change pagination range
function pagination_range_number( $variable ) {
	$variable = 1;
	return $variable;
}
add_filter( 'pagination_range', 'pagination_range_number' );

Post Navigationpost_navigation

Controls the text links for standard page navigation for pages displaying the post feed. Also controls the text for previous and next articles on single post pages.

Show me an example!

// Change feed post navigation
function feed_navigation( $variable ) {
    $search = array( '← Older posts', 'Newer posts →' );
    $replace = array( 'Previous articles', 'Newer articles' );
    $variable = str_replace( $search, $replace, $variable );
    return $variable;
}
add_filter( 'post_navigation', 'feed_navigation' );

Feed Post Page Navigationfeed_post_page_nav

When single posts have internal page navigation, the text in this filter will control the pagination introduction text.

Show me an example!

// Change feed paginated post text
function feed_paginated_post( $variable ) {
	$variable = str_replace( 'Pages:', 'Articles:', $variable );
	return $variable;
}
add_filter( 'feed_post_page_nav', 'feed_paginated_post' );

Internal Post Navigationpost_page_nav

On single posts broken into multiple pages, this text displays before the linked page numbers.

Show me an example!

// Change paginated post text
function paginated_post( $variable ) {
	$variable = str_replace( 'Pages:', 'Articles:', $variable );
	return $variable;
}
add_filter( 'post_page_nav', 'paginated_post' );

Internal Page Navigationpage_page_nav

On pages broken into multiple pages, this text displays before the linked page numbers.

Show me an example!

// Change paginated page text
function paginated_page( $variable ) {
	$variable = str_replace( 'Pages:', 'Articles:', $variable );
	return $variable;
}
add_filter( 'page_page_nav', 'paginated_page' );

Internal Attachment Navigationattachment_page_nav

On attachment pages broken into multiple pages, this text displays before the linked page numbers.

Show me an example!

// Change paginated attachment text
function paginated_attachment( $variable ) {
	$variable = str_replace( 'Pages:', 'Attachments:', $variable );
	return $variable;
}
add_filter( 'attachment_page_nav', 'paginated_attachment' );

Attachment Navigationattachment_navigation

On attachment pages, this text links to the previous and next attachment page.

Show me an example!

// Change attachment navigation links
function attachment_nav( $variable ) {
    $search = array( '← Previous', 'Next →' );
    $replace = array( 'Previous attachments', 'Newer attachments' );
    $variable = str_replace( $search, $replace, $variable );
    return $variable;
}
add_filter( 'attachment_navigation', 'attachment_nav' );

Links to Articles

Excerpt Linksexcerpt_link

When post excerpts are enabled, you also have an option to link to the article at the end of the excerpt. With that option enabled, this filter controls the link text.

Show me an example!

// Change excerpt link
function custom_excerpt_link( $variable ) {
	$variable = str_replace( 'Read More →', 'Continue reading →', $variable );
	return $variable;
}
add_filter( 'excerpt_link', 'custom_excerpt_link' );

More Link Textmore_link_text

With full posts displayed in a feed, you have the option to manually truncate your posts. This filter controls that link text.

Show me an example!

// Change read more link
function read_more_link( $variable ) {
	$variable = str_replace( 'Read More →', 'Continue reading →', $variable );
	return $variable;
}
add_filter( 'more_link_text', 'read_more_link' );

Post Byline

Byline Textbyline_text

This filter controls all static text in the byline (not the links).

Show me an example!

// Change byline static text
function static_byline_text( $variable ) {
    $search = array( 'Published on', 'by', '–', 'Comments off', 'Filed under:' );
    $replace = array( 'on', 'author', '', 'Comments disabled', 'Topics' );
    $variable = str_replace( $search, $replace, $variable );
    return $variable;
}
add_filter( 'byline_text', 'static_byline_text' );

Comments

Comments Titlecomments_title

This text introduces the comments section.

Show me an example!

// Change comments title
function comments_title_text( $variable ) {
	global $count;
	$variable = str_replace( 
		__(_n('1 Comment:', '%1$s Comments:', comments_only_count($count), 'volatyl'), 'volatyl'), 
		__(_n('1 person has commented... <a href="#commentform">contribute</a>', '%1$s people have commented... <a href="#commentform">contribute</a>', comments_only_count($count), 'volatyl'), 'volatyl'), 
		$variable );
	return $variable;
}
add_filter( 'comments_title', 'comments_title_text' );

Pings Titlepings_title

If pings are displayed, this text introduces the pings section.

Show me an example!

// Change pings title
function pings_title_text( $variable ) {
	global $count;
	$variable = str_replace( 
		__(_n('1 Ping:', '%1$s Pings:', get_comments_number() - comments_only_count($count), 'volatyl'), 'volatyl'), 
		__(_n('1 article links to this page.', '%1$s articles link to this page.', comments_only_count($count), 'volatyl'), 'volatyl'), 
		$variable );
	return $variable;
}
add_filter( 'pings_title', 'pings_title_text' );

Comment Textcomments_text

This filter controls many elements in the comments area. “Comments are closed,” comments navigation links, comment reply title, and submit button text area controlled with this filter.

Show me an example!

// Change comments static text
function custom_comments_text( $variable ) {
    $search = array( 'Comments are closed.', '&larr; Older comments', 'Newer comments &rarr;', 'Leave a Reply', 'Submit Comment' );
    $replace = array( 'Sorry. The discussion has ended.', '&larr; See older', 'See newer &rarr;', 'Topics:', 'Speak Your Mind' );
    $variable = str_replace( $search, $replace, $variable );
    return $variable;
}
add_filter( 'comments_text', 'custom_comments_text' );

Comment Avatar Sizeavatar_size

This filter controls the size of comment avatars. They are 50px by 50px by default. Only one value is required and will be used for both height and width.

Show me an example!

// Change comment avatar size
function my_avatar_size( $size ) {
    $size = 30;
    return $size;
}
add_filter( 'avatar_size', 'my_avatar_size' );

Search Form

Search Textsearch_text

This filter controls the placeholder text for the search form as well as the search form submit button if you have it displayed.

Show me an example!

// Change search form text
function search_text( $variable ) {
    $search = array( 'Enter Keyword(s)&hellip;', 'Search' );
    $replace = array( 'Ex. Awesome', 'Submit' );
    $variable = str_replace( $search, $replace, $variable );
    return $variable;
}
add_filter( 'search_text', 'search_text' );

Search & Archives (categories, tags, authors, dates, etc.)

Search Titlesearch_title

On search result pages, this text displays as the main title directly before the search query.

Show me an example!

// Change search query results title
function search_query_title( $variable ) {
	$variable = str_replace( 'Search Results for:', 'Related to:', $variable );
	return $variable;
}
add_filter( 'search_title', 'search_query_title' );

Archive Titlearchive_title

On archive pages, this text displays as the main archive title.

Show me an example!

// Change archive title text
function archive_title_text( $variable ) {
    $search = array( 'Category Archives:', 'Tag Archives:', 'Author Archives:', 'Daily Archives:', 'Monthly Archives:', 'Yearly Archives:', 'Archive' );
    $replace = array( '', '', '', '', '', '', '' ); // No titles... just archive name.
    $variable = str_replace( $search, $replace, $variable );
    return $variable;
}
add_filter( 'archive_title', 'archive_title_text' );

Feed Tags Textfeed_tags_text

On article feeds such as the blog home or search results, this filter controls the text that introduces the tags list.

Show me an example!

// Change feed tag text
function feed_tag_text( $variable ) {
	$variable = str_replace( 'Tags:', 'Subjects:', $variable );
	return $variable;
}
add_filter( 'feed_tags_text', 'feed_tag_text' );

Single Tags Textsingle_tags_text

On single posts, this filter controls the text that introduces the tags list.

Show me an example!

// Change post tag text
function single_tag_text( $variable ) {
	$variable = str_replace( 'Tags:', 'Subjects:', $variable );
	return $variable;
}
add_filter( 'single_tags_text', 'single_tag_text' );

Menus

Header Menu Toggleheader_menu_toggle

Control the open and close toggle links for the header menu.

Show me an example!

// Change header menu responsive toggle
function header_menu_toggle_link( $variable ) {
    $variable = str_replace( 'Menu', 'Info', $variable );
    return $variable;
}
add_filter( 'header_menu_toggle', 'header_menu_toggle_link' );

Standard Menu Togglestandard_menu_toggle

Control the open and close toggle links for the standard menu.

Show me an example!

// Change standard menu responsive toggle
function standard_menu_toggle_link( $variable ) {
    $variable = str_replace( 'Navigation', 'Pages', $variable );
    return $variable;
}
add_filter( 'standard_menu_toggle', 'standard_menu_toggle_link' );

Footer Menu Togglefooter_menu_toggle

Control the open and close toggle links for the footer menu.

Show me an example!

// Change footer menu responsive toggle
function footer_menu_toggle_link( $variable ) {
    $variable = str_replace( 'Navigation', 'Pages', $variable );
    return $variable;
}
add_filter( 'footer_menu_toggle', 'footer_menu_toggle_link' );

Menu Descriptionsmenu_descriptions

In the “Menus” screen of the WordPress dashboard, menus are set to be displayed in the “Theme Locations” section. Above the drop down selections for each menu, descriptions of the menus are controlled by this filter.

Show me an example!

// Change menu descriptions
function menu_description_text( $variable ) {
    $search = array( 'Header Menu (Supports 1 drop-down level)', 'Standard Menu (unlimited drop-downs)', 'Footer Menu (unlimited drop-downs)' );
    $replace = array( 'This is the header menu', 'This is the standard menu', 'This is the footer menu' );
    $variable = str_replace( $search, $replace, $variable );
    return $variable;
}
add_filter( 'menu_descriptions', 'menu_description_text' );

404 Error Page

404 Error Contenterror_404_content

404 Error pages include a title, introduction text, and a list of widgets. To override the entire file, you’d need to use a child theme. To simply change the title and introduction text, use this filter.

Show me an example!

// Change 404 Error content
function error_404_title_intro( $variable ) {
    $search = array( 
    	'Oops! Looks like we have an error.', 
    	'Use the search form and other tools below to find what you were looking for.' );
    $replace = array( 
    	'How did you even get here?', 
    	'It doesn\'t matter. Let\'s fix this issue with the tools below.' );
    $variable = str_replace( $search, $replace, $variable );
    return $variable;
}
add_filter( 'error_404_content', 'error_404_title_intro' );

For more details on how these filters are structured and an explanation of the code, see the Volatyl Filters Guide.

Return to docs