{"id":34638717,"url":"https://github.com/generoi/wp-hero","last_synced_at":"2026-05-29T09:31:24.681Z","repository":{"id":147858799,"uuid":"101458972","full_name":"generoi/wp-hero","owner":"generoi","description":"A hero banner plugin for Wordpress using ACF and Timber","archived":false,"fork":false,"pushed_at":"2025-03-04T13:41:09.000Z","size":141,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-26T06:15:53.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generoi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-26T03:08:06.000Z","updated_at":"2025-06-03T19:22:27.000Z","dependencies_parsed_at":"2023-05-27T17:30:15.742Z","dependency_job_id":null,"html_url":"https://github.com/generoi/wp-hero","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/generoi/wp-hero","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-hero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-hero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-hero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-hero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generoi","download_url":"https://codeload.github.com/generoi/wp-hero/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-hero/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33646420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T17:12:54.353Z","updated_at":"2026-05-29T09:31:24.655Z","avatar_url":"https://github.com/generoi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wp-hero\n\n\u003e A hero banner plugin for Wordpress using ACF and Timber.\n\n## Requirements\n\n- Advanced Custom Fields PRO\n- Timber Library\n- WP Timber Extended\n\n## Features\n\n- Provide a Hero banner field on posts and terms\n- Multiple slides\n- Video or image as well as title and caption\n- Theme and overlay options for making content easier to read\n- Linking slides to pages\n- Force crop ratio\n- Adds retina images\n- Supports art direction using the [YoImages](https://wordpress.org/plugins/yoimages/) plugin\n- Supports focus point cropping using the [WP SmartCrop](https://wordpress.org/plugins/wp-smartcrop/) plugin\n- Integrates with [Yoast SEO](https://wordpress.org/plugins/wordpress-seo/) OG images\n- Supports fallback slides using Featured Images, parent posts and/or a default image (@todo)\n- Maintains aspect ratio without browser reflows\n\n## Usage\n\nAdd the hero component to the timber context.\n\n```php\nadd_filter('timber/context', function ($context) {\n    $context['hero'] = new GeneroWP\\Hero\\Hero();\n});\n```\n\nSee [generoi/sage](https://github.com/generoi/sage/blob/genero/resources/views/layout/hero.twig) for an example timber template.\n\n## API\n\n```php\nadd_filter('wp-hero/visible', '__return_false');\nadd_filter('wp-hero/visible/{taxonomy|post_type}', function ($match, $taxonomy) {\n  if ($taxonomy === 'foobar') {\n    $match = false;\n  }\n  return $match;\n}, 10, 2);\n\n// Disable slide fallback functionality.\nadd_filter('wp-hero/fallback', function () {\n  return is_single() \u0026\u0026 !is_singular('job');\n});\nadd_filter('wp-hero/fallback/thumbnail', '__return_false');\nadd_filter('wp-hero/fallback/parent', '__return_false');\nadd_filter('wp-hero/fallback/default_image', '__return_false');\n\n// Set a default slide fallback\nadd_filter('wp-hero/fallback/default', function ($defaults) {\n    return SlideFactory::create([\n        'slide_type' =\u003e 'image',\n        'slide_image' =\u003e asset_path('images/hero.jpg'),\n        'slide_title' =\u003e get_the_title(),\n    ]);\n});\n\n// Modify/add breakpoint thumbnail sizes and minimum widths.\nadd_filter('wp-hero/slide/breakpoints', function ($breakpoints) {\n  $breakpoints['desktop']['min-width'] = '1200px';\n});\n\n// Whether to convert all slide images to JPGs.\nadd_filter('wp-hero/slide/tojpg', '__return_false');\n\n// Set default slide values.\nadd_filter('wp-hero/slide/defaults', function ($defaults) {\n  $defaults['slide_title'] = 'Foobar';\n  return $defaults;\n});\nadd_filter('wp-hero/slide/defaults/{image|video}', function ($defaults) {\n  $defaults['slide_video_poster'] = 'xyz';\n  return $defaults;\n});\n\n// Add custom overlay or theme options\nadd_filter('acf/load_field/name=slide_overlay', function ($field) {\n    $field['choices']['primary'] = __('Primary');\n    return $field;\n});\nadd_filter('acf/load_field/name=slide_theme', function ($field) {\n    unset($field['choices']['boxed']);\n    return $field;\n});\n```\n\n## Development\n\nInstall dependencies\n\n    composer install\n    npm install\n\nRun the tests\n\n    npm run test\n\nBuild assets\n\n    # Minified assets which are to be committed to git\n    npm run build\n\n    # Development assets while developing the plugin\n    npm run build:development\n\n    # Watch for changes and re-compile while developing the plugin\n    npm run watch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fwp-hero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneroi%2Fwp-hero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fwp-hero/lists"}