Castlegate IT WP SEO Headings archived
Yoast- and ACF-compatible SEO headings
by Castlegate IT · github.com/castlegateit/cgit-wp-seo-headings · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/castlegateit/cgit-wp-seo-headings/archive/refs/heads/main.zipDeclares an update source (https://github.com/castlegateit/cgit-wp-seo-headings), so updates arrive through the plugin's own updater.
Readme
Castlegate IT WP SEO Headings
SEO Headings provides a function that returns the text of an optimized heading for a WordPress theme:
<h1>
<a href="<?= home_url('/') ?>">
<img src="logo.png" alt="<?= cgit_seo_heading() ?>">
</a>
</h1>
Headings
The heading is returned as follows:
-
The function can be passed an optional string parameter. If this is set and non-empty, the string will be returned unmodified. For example
cgit_seo_heading('Hello World')will returnHello World. -
If the function parameter is not set, Advanced Custom Fields is active, and the page is a single post of any public post type, the function will check the value of the SEO heading field of the current post. If this is non-empty, its value will be returned.
-
If ACF is not active or if the SEO heading field is empty, the function will return the page title. If Yoast is active, it will return the title generated by Yoast.
-
If none of the above attempts have provided a non-empty string, the function will return the site name.
Filters
The plugin provides the following filters for customization:
-
cgit_seo_headings_post_typesAn array of post types that should display the ACF SEO heading field. By default, this contains all public post types. -
cgit_seo_headings_menu_orderAn integer representing the menu order of the ACF SEO headings field group. By default, this is set to 500. -
cgit_seo_headings_field_group_argsThe complete array of parameters used to define the ACF field group. This is applied after the post type and menu order filters described above. -
cgit_seo_headings_move_yoastA boolean that determines whether the Yoast fields should be moved from their default position above the ACF fields to a position below the ACF fields. The default value istrue, which means the Yoast fields are moved to the bottom of the screen. -
cgit_seo_headings_remove_default_sitenameA boolean that determines whether the site name should be automatically removed from the heading if the Yoast title is used as the heading value. When enabled, any Yoast separator followed by the site name at the end of the string will be removed. Default value istrue.
License
Released under the MIT License. See LICENSE for details.
Read the full README on GitHub →
Releases
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.