website
Table of Contents
Classes
- Updater
- Theme updater.
Constants
- THEME_NAME = 'GP-pfeifferNet'
- Define theme name constant.
Functions
- modify_archive_order() : void
- Change sort order of archive pages where required.
- modify_archive_title() : string
- Remove prefix for taxonomy name from archive titles.
- register_styles() : void
- Register styles.
- enqueue_assets() : void
- Enqueue the scripts and styles.
- disable_child_theme_load() : bool
- Prevent generatepress from loading child theme stylesheet.
- get_asset_version() : string
- Return the version.
- enable_custom_image_template() : void
- Enable the custom template part on the image attachment page.
- disable_image_template() : bool
- Disable the core template part on the image attachment page.
- filter_author_interests() : array<string|int, mixed>
- Filter the author interests.
- add_image_sizes() : void
- Add custom image sizes.
- filter_image_attributes() : array<string|int, mixed>
- Filter the image attributes.
- filter_private_title() : string
- Filters the text prepended to the post title of private posts.
- set_search_placeholder_text() : string
- Set search placeholder text.
- filter_related_posts() : array<string|int, mixed>
- Filter the related posts query args to add related post list.
- get_theme_metadata() : string
- Return a metadata value.
- remove_admin_bar() : void
- Hide WordPress admin bar for all but administrator.
- remove_image_nav() : void
- Remove #main anchor from attachment links.
- theme_support() : void
- Override theme supported features.
- post_type_support() : void
- Add feature support to post types.
- title_separator() : string
- Set page title separator.
- read_more_link() : bool
- Change the read more link to prevent scroll on target page.
- disable_schema() : bool
- Override theme generated schema.
- show_visual_format_excerpt() : bool
- Show excerpts for visual post formats.
- get_scroll_offset() : int
- Get the offset from top of page for smooth scroll.
- filter_main_menu() : array<string|int, mixed>
- Filter the user's name into the "member" primary menu item.
- add_rankmath_hooks() : void
- Add the rankmath hooks.
- modify_breadcrumb_html() : string
- Modify the breadcrumb HTML.
- modify_toc_content() : string
- Modify the TOC HTML.
Constants
THEME_NAME
Define theme name constant.
public
mixed
THEME_NAME
= 'GP-pfeifferNet'
Tags
Functions
modify_archive_order()
Change sort order of archive pages where required.
modify_archive_order(WP_Query $query) : void
Do not change order on admin pages.
Parameters
- $query : WP_Query
-
The WP_Query instance(passed by reference).
Tags
modify_archive_title()
Remove prefix for taxonomy name from archive titles.
modify_archive_title(string $title, string $original_title, string $prefix) : string
Parameters
- $title : string
-
Archive title.
- $original_title : string
-
Archive title without prefix.
- $prefix : string
-
Archive title prefix.
Tags
Return values
string —The (maybe) modified archive title.
register_styles()
Register styles.
register_styles() : void
The asset must start with a leading slash. It is relative to the assets directory.
Tags
enqueue_assets()
Enqueue the scripts and styles.
enqueue_assets() : void
Tags
disable_child_theme_load()
Prevent generatepress from loading child theme stylesheet.
disable_child_theme_load() : bool
The stylesheet will have dependencies added and enqueued late in loadng process,
Tags
Return values
boolget_asset_version()
Return the version.
get_asset_version(string $asset_path) : string
Parameters
- $asset_path : string
-
The fully qualified asset path.
Tags
Return values
string —The resource version.
enable_custom_image_template()
Enable the custom template part on the image attachment page.
enable_custom_image_template(string $template) : void
Parameters
- $template : string
-
Not used.
Tags
disable_image_template()
Disable the core template part on the image attachment page.
disable_image_template(bool $flag) : bool
Parameters
- $flag : bool
-
Flag to determine use of standard template part.
Tags
Return values
bool —The (maybe) modified flag.
filter_author_interests()
Filter the author interests.
filter_author_interests(array<string|int, mixed> $qv, array<string|int, mixed> $attributes) : array<string|int, mixed>
Filter on 'featured' posts to limit to the author.
Parameters
- $qv : array<string|int, mixed>
-
The WP_Query args.
- $attributes : array<string|int, mixed>
-
The Generateblock Query Loop block attributes.
Tags
Return values
array<string|int, mixed> —The (maybe) modified query arguments.
add_image_sizes()
Add custom image sizes.
add_image_sizes() : void
Add cropping to default medium image. Specify the 400px wide 5x3 size. Add proportional size for medium images. Add 1160px wide 5x3 ratio for featured and in-post full-width images. Add 1160px wide proportional size for attachment pages.
Tags
filter_image_attributes()
Filter the image attributes.
filter_image_attributes(array<string|int, mixed> $attr, WP_Post $attachment, array<string|int, mixed>|string $size) : array<string|int, mixed>
Parameters
- $attr : array<string|int, mixed>
-
Array of attribute values for the image markup, keyed by attribute name.
- $attachment : WP_Post
-
Image attachment post.
- $size : array<string|int, mixed>|string
-
Requested image size.
Tags
Return values
array<string|int, mixed> —The modified attribute values for markup.
filter_private_title()
Filters the text prepended to the post title of private posts.
filter_private_title(string $prepend, WP_Post $post) : string
- Single pages or posts have no prepended text.
- Prepend a member-only notice everywhere else.
Parameters
- $prepend : string
-
Text displayed before the post title. Default 'Private: %s'.
- $post : WP_Post
-
Current post object.
Tags
Return values
string —The (maybe) modified prepend string.
set_search_placeholder_text()
Set search placeholder text.
set_search_placeholder_text() : string
Tags
Return values
string —Search placeholder text.
filter_related_posts()
Filter the related posts query args to add related post list.
filter_related_posts(array<string|int, mixed> $qv, array<string|int, mixed> $attributes) : array<string|int, mixed>
Parameters
- $qv : array<string|int, mixed>
-
The WP_Query args.
- $attributes : array<string|int, mixed>
-
The Generateblocks Query Loop block attributes.
Tags
Return values
array<string|int, mixed> —The (maybe) modified query arguments.
get_theme_metadata()
Return a metadata value.
get_theme_metadata(string $field) : string
Parameters
- $field : string
-
The field to search for.
Tags
Return values
string —The metadata value.
remove_admin_bar()
Hide WordPress admin bar for all but administrator.
remove_admin_bar() : void
Tags
remove_image_nav()
Remove #main anchor from attachment links.
remove_image_nav() : void
Tags
theme_support()
Override theme supported features.
theme_support() : void
Tags
post_type_support()
Add feature support to post types.
post_type_support() : void
- Enable the excerpt meta box in page edit screen.
Tags
title_separator()
Set page title separator.
title_separator(string $separator) : string
Parameters
- $separator : string
-
Document title separator.
Tags
Return values
string —Modified document title separator.
read_more_link()
Change the read more link to prevent scroll on target page.
read_more_link() : bool
Tags
Return values
bool —Scroll to
disable_schema()
Override theme generated schema.
disable_schema() : bool
- Now uses RankMath generated schema.
Tags
Return values
boolshow_visual_format_excerpt()
Show excerpts for visual post formats.
show_visual_format_excerpt(bool $show_excerpt) : bool
Parameters
- $show_excerpt : bool
-
Boolean to show excerpts or not.
Tags
Return values
bool —The modifed value.
get_scroll_offset()
Get the offset from top of page for smooth scroll.
get_scroll_offset() : int
Tags
Return values
int —The number of pixels to offset the scroll.
filter_main_menu()
Filter the user's name into the "member" primary menu item.
filter_main_menu(array<string|int, mixed> $sorted_menu_items, object $args) : array<string|int, mixed>
Parameters
- $sorted_menu_items : array<string|int, mixed>
-
The menu items, sorted by each menu item’s menu order.
- $args : object
-
An object containing the wp_nav_menu() arguments.
Tags
Return values
array<string|int, mixed> —The (maybe) modified menu items.
add_rankmath_hooks()
Add the rankmath hooks.
add_rankmath_hooks() : void
- This approach is recommended by RankMath.
Tags
modify_breadcrumb_html()
Modify the breadcrumb HTML.
modify_breadcrumb_html(string $html, array<string|int, mixed> $crumbs, object $breadcrumbs) : string
- Remove the whitespace from the separator breadcrumb item.
Parameters
- $html : string
-
The breadcrumb HTML.
- $crumbs : array<string|int, mixed>
-
The breadcrumb items.
- $breadcrumbs : object
-
The breadcrumbs object.
Tags
Return values
string —The modified breadcrumb HTML content.
modify_toc_content()
Modify the TOC HTML.
modify_toc_content(string $block_content, array<string|int, mixed> $block, WP_Block $instance) : string
- Add smooth-scroll class to list items.
Parameters
- $block_content : string
-
The block content.
- $block : array<string|int, mixed>
-
The full block, including name and attributes.
- $instance : WP_Block
-
The instance of the rank-math/toc-block.
Tags
Return values
string —The modified TOC block HTML content.